Copy_File() {
src="$1"; dst="$2"; own="$3"; perm="$4"
echo " $src -> $dst\c"
- grep "alex@barton.de" "$dst" >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo " (B)\c"
- cp "$dst" "$dst.bak"
+ if [ -e "$dst" ]; then
+ grep "alex@barton.de" "$dst" >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo " (B)\c"
+ cp "$dst" "$dst.bak"
+ fi
fi
echo " \c"
cp "$src" "$dst" || Abort
echo "- OK."
}
-echo "Running $NAME ..."
+[ -n "$UID" ] || UID=`id -u`
+export UID
-if [ "$UID" -eq 0 ]; then
+echo "Running $NAME (uid=$UID) ..."
+
+if [ "$UID" = "0" ]; then
echo "Starting system configuration:"
echo " - bash shell:"
if [ -e /etc/bash.bashrc ]; then
user=`basename "$HOME"`
echo "Starting user configuration ($user in $HOME):"
echo " - bash shell:"
-Copy_File user/bash_profile "$HOME/.bash_profile" "$user" 600
+if [ -e "$HOME/.profile" ]; then
+ Copy_File user/bash_profile "$HOME/.profile" "$user" 600
+else
+ Copy_File user/bash_profile "$HOME/.bash_profile" "$user" 600
+fi
Copy_File user/bashrc "$HOME/.bashrc" "$user" 600
Copy_File user/bash_logout "$HOME/.bash_logout" "$user" 600