local fullpath="$(readlink -f "$path")"
#e $fullpath $below # debug
if [[ -f $path || $(dirname $(readlink -f "$fullpath")) == "$below" ]]; then
- if [[ $dir == /p/* ]]; then
- homes=(/home/ian)
- else
- homes=(/home/*)
- fi
- for user in ${homes[@]}; do
- sysv lnf -T "$path" "$user/${path#$root/}"
- done
+ sysv lnf -T "$path" "$HOME/${path#$root/}"
elif [[ -d "$path" ]]; then
subdir-link-r "$root" "$path"
fi
(( ${#x[@]} >= 1 )) || return 0
sysv lnf ${x[@]} ~
# as of this writing, it doesn't exist in /a/c, but I've used it in the past.
- if [[ -e $1/filesystem ]]; then
+ if [[ -e $1/filesystem && $USER == ian ]]; then
sysv s cp -R $1/filesystem/* /
fi
}
-# p needs to go first so .ssh link is created, then config link inside it
-for dir in {/a/c,/p/c}{,/machine_specific/$HOSTNAME}; do
- common-file-setup $dir
-done
+case $USER in
+ ian)
+ # p needs to go first so .ssh link is created, then config link inside it
+ for dir in {/a/c,/p/c}{,/machine_specific/$HOSTNAME}; do
+ common-file-setup $dir
+ done
+ sudo -u traci "$BASH_SOURCE"
+ ;;
+ traci)
+ for dir in /a/c{,/machine_specific/$HOSTNAME}; do
+ common-file-setup $dir
+ done
+ ;;
+ *)
+ echo "$0: error: run as ian or traci"
+ exit 1
+ ;;
+esac