]> arthur.barton.de Git - ConfigScripts.git/commitdiff
Detect root user correctly, even when using NIS.
authorAlexander Barton <alex@barton.de>
Mon, 5 Jan 2009 16:05:35 +0000 (17:05 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 5 Jan 2009 16:05:35 +0000 (17:05 +0100)
install.sh

index 4645cbd19f022fdfcecbb79955b264c507b15537..ddf2a3da5f9fca638d6dd26729f499006fe1deec 100755 (executable)
@@ -82,7 +82,7 @@ Config_User() {
 
 Config_RootUser() {
        if [ "$UID" = "0" ]; then
-               user=`grep "^.*:.*:0:" /etc/passwd | cut -d':' -f1`
+               user=`grep "^.*:.*:0:" /etc/passwd | head -n 1 | cut -d':' -f1`
                home=`grep "^.*:.*:0:" /etc/passwd | cut -d':' -f6`
                Config_User "$user" "$home"
        else