From: Alexander Barton Date: Thu, 7 Apr 2011 13:09:14 +0000 (+0200) Subject: Copy user files to /etc/skel directory, if it is writeable X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ConfigScripts.git;a=commitdiff_plain;h=adb60776f147e5d77d32909f55aace5b147514e2 Copy user files to /etc/skel directory, if it is writeable --- diff --git a/install.sh b/install.sh index b150112..877058b 100755 --- a/install.sh +++ b/install.sh @@ -84,6 +84,21 @@ Config_User() { fi } +Config_Skel() { + if [ -w /etc/skel ]; then + Msg "Starting \"/etc/skel\" configuration:\n" + Copy_File user/bash_logout /etc/skel/.bash_logout + if [ -e /etc/skel/.profile ]; then + Copy_File user/bash_profile /etc/skel/.profile root 644 + else + Copy_File user/bash_profile /etc/skel/.bash_profile root 644 + fi + Copy_File user/bashrc /etc/skel/.bashrc root 644 + else + Msg "Can't write to \"/etc/skel\" - configuration SKIPPED.\n" + fi +} + Config_RootUser() { if [ "$UID" = "0" ]; then user=`grep "^.*:.*:0:" /etc/passwd | head -n 1 | cut -d':' -f1` @@ -113,6 +128,7 @@ Msg "Running $NAME (uid=$UID) ...\n" user=`basename "$HOME"` Config_System +Config_Skel Config_User "$user" "$HOME" Config_RootUser