3 # ConfigScripts - install.sh
4 # Written by Alexander Barton <alex@barton.de>. Public Domain.
15 src="$1"; dst="$2"; own="$3"; perm="$4"
16 echo " $src -> $dst\c"
17 if [ -e "$dst" ]; then
18 grep "alex@barton.de" "$dst" >/dev/null 2>&1
25 cp "$src" "$dst" || Abort
26 [ -n "$own" ] && chown "$own" "$dst" || Abort
27 [ -n "$perm" ] && chmod "$perm" "$dst" || Abort
31 [ -n "$UID" ] || UID=`id -u`
34 echo "Running $NAME (uid=$UID) ..."
36 if [ "$UID" = "0" ]; then
37 echo "Starting system configuration:"
39 if [ -e /etc/bash.bashrc ]; then
40 Copy_File sys/bashrc /etc/bash.bashrc root 644
42 Copy_File sys/bashrc /etc/bashrc root 644
44 Copy_File sys/profile /etc/profile root 644
46 echo "Not running with root privileges - system configuration SKIPPED."
49 user=`basename "$HOME"`
50 echo "Starting user configuration ($user in $HOME):"
52 Copy_File user/bash_profile "$HOME/.bash_profile" "$user" 600
53 Copy_File user/bashrc "$HOME/.bashrc" "$user" 600
54 Copy_File user/bash_logout "$HOME/.bash_logout" "$user" 600