From: Alexander Barton Date: Mon, 5 Jan 2009 15:11:53 +0000 (+0100) Subject: New function Config_RootUser() to copy files into $HOME of root user. X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ConfigScripts.git;a=commitdiff_plain;h=947066158ef0ae5e8aead593215ea5b0c0ef566f New function Config_RootUser() to copy files into $HOME of root user. --- diff --git a/install.sh b/install.sh index 4f60f06..4645cbd 100755 --- a/install.sh +++ b/install.sh @@ -80,6 +80,16 @@ Config_User() { fi } +Config_RootUser() { + if [ "$UID" = "0" ]; then + user=`grep "^.*:.*:0:" /etc/passwd | cut -d':' -f1` + home=`grep "^.*:.*:0:" /etc/passwd | cut -d':' -f6` + Config_User "$user" "$home" + else + Msg "Not running with root privileges - root user configuration SKIPPED.\n" + fi +} + [ -n "$UID" ] || UID=`id -u` export UID @@ -89,6 +99,7 @@ user=`basename "$HOME"` Config_System Config_User "$user" "$HOME" +Config_RootUser Msg "$NAME: Done.\n"