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 echo "Running $NAME ..."
33 if [ "$UID" -eq 0 ]; then
34 echo "Starting system configuration:"
36 if [ -e /etc/bash.bashrc ]; then
37 Copy_File sys/bashrc /etc/bash.bashrc root 644
39 Copy_File sys/bashrc /etc/bashrc root 644
41 Copy_File sys/profile /etc/profile root 644
43 echo "Not running with root privileges - system configuration SKIPPED."
46 user=`basename "$HOME"`
47 echo "Starting user configuration ($user in $HOME):"
49 Copy_File user/bash_profile "$HOME/.bash_profile" "$user" 600
50 Copy_File user/bashrc "$HOME/.bashrc" "$user" 600
51 Copy_File user/bash_logout "$HOME/.bash_logout" "$user" 600