]> arthur.barton.de Git - ConfigScripts.git/blobdiff - install.sh
Read global files from $HOME/.etc if we can't install to /etc.
[ConfigScripts.git] / install.sh
index ad13c6b3afa8fa7aa11a2d19d200660f1ffd2db3..c02d344ff1f66e0bacae4c9197303d4872677f41 100755 (executable)
@@ -37,6 +37,8 @@ export UID
 
 Msg "Running $NAME (uid=$UID) ..."
 
+user=`basename "$HOME"`
+
 if [ "$UID" = "0" ]; then
        Msg "Starting system configuration:"
        Msg " - bash shell:"
@@ -48,9 +50,17 @@ if [ "$UID" = "0" ]; then
        Copy_File sys/profile /etc/profile root 644
 else
        Msg "Not running with root privileges - system configuration SKIPPED."
+       grep "alex@barton.de" /etc/profile >/dev/null 2>&1
+       if [ $? -ne 0 ]; then
+               Msg "Installing system files to $HOME/.etc/ ..."
+               mkdir -p "$HOME/.etc"
+               Copy_File sys/bashrc $HOME/.etc/bashrc "$user" 600
+               Copy_File sys/profile $HOME/.etc/profile "$user" 600
+       else
+               Msg "System configuration seems to be modified: not installing locally."
+       fi
 fi
 
-user=`basename "$HOME"`
 touch "$HOME/.test.$$" >/dev/null 2>&1
 if [ $? -eq 0 ]; then
        rm -f "$HOME/.test.$$"