]> arthur.barton.de Git - ConfigScripts.git/commitdiff
Read global files from $HOME/.etc if we can't install to /etc.
authorAlexander Barton <alex@barton.de>
Fri, 21 Nov 2008 09:40:46 +0000 (10:40 +0100)
committerAlexander Barton <alex@barton.de>
Fri, 21 Nov 2008 09:40:46 +0000 (10:40 +0100)
install.sh
user/bash_profile
user/bashrc

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.$$"
index 9801fd536fe0dcd1d8ec08fdc788e0c2b6a9f554..697a5e8473f4ebbe717d121d158abea67808bd72 100644 (file)
@@ -11,6 +11,8 @@
 
 [ -e /tmp/ConfigDebug.$USER ] && echo " >> ~/.bash_profile ..."
 
+[ -z "$PROFILEREAD" -a -r $HOME/.etc/profile ] && source $HOME/.etc/profile
+
 [ -n "$LANG" ] || export LANG="de_DE.ISO8859-1"
 export LC_MESSAGES="C"
 export EMAIL="alex@barton.de"
index 58ad4eeeacd45e37c885c55ace7eec85b36b1f77..3c5815e443bf002c4beb989c91be49f9414ea7b0 100644 (file)
@@ -11,6 +11,7 @@
 
 [ -z "$BASHRCREAD" -a -r /etc/bash.bashrc ] && source /etc/bash.bashrc
 [ -z "$BASHRCREAD" -a -r /etc/bashrc ] && source /etc/bashrc
+[ -z "$BASHRCREAD" -a -r $HOME/.etc/bashrc ] && source $HOME/.etc/bashrc
 
 # aptitude
 type -p aptitude >/dev/null 2>&1