From: Alexander Barton Date: Fri, 21 Nov 2008 09:40:46 +0000 (+0100) Subject: Read global files from $HOME/.etc if we can't install to /etc. X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ConfigScripts.git;a=commitdiff_plain;h=5a35901097964ddf81e36c402b0057362448af6f Read global files from $HOME/.etc if we can't install to /etc. --- diff --git a/install.sh b/install.sh index ad13c6b..c02d344 100755 --- a/install.sh +++ b/install.sh @@ -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.$$" diff --git a/user/bash_profile b/user/bash_profile index 9801fd5..697a5e8 100644 --- a/user/bash_profile +++ b/user/bash_profile @@ -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" diff --git a/user/bashrc b/user/bashrc index 58ad4ee..3c5815e 100644 --- a/user/bashrc +++ b/user/bashrc @@ -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