]> arthur.barton.de Git - ConfigScripts.git/commitdiff
New function Config_RootUser() to copy files into $HOME of root user.
authorAlexander Barton <alex@barton.de>
Mon, 5 Jan 2009 15:11:53 +0000 (16:11 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 5 Jan 2009 15:11:53 +0000 (16:11 +0100)
install.sh

index 4f60f06ece84adab0d2bb4d812bdefb8c95758b7..4645cbd19f022fdfcecbb79955b264c507b15537 100755 (executable)
@@ -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"