4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
14 if [[ -e /root
/.unison
&& ! -L /root
/.unison
]]; then
15 d
=/q
/p
/c
/machine_specific
/$host/.unison
17 mv -f /root
/.unison
/* $d
28 # if we make a link back to the root, traversing the subdirs stops.
29 # This makes it so we can do subdir directories. Must call with absolute
36 targets
=( "$2"/!(.git
) )
38 for f
in "$1"/!(.git
); do
39 [[ -d $f ]] && targets
+=("$f") ||
:
42 local below
="$( readlink -f "$root/..
")"
43 for path
in "${targets[@]}"; do
44 local fullpath
="$(readlink -f "$path")"
45 #e $fullpath $below # debug
46 if [[ -f $path || $
(dirname $
(readlink
-f "$fullpath")) == "$below" ]]; then
47 sysv lnf
-T "$path" "$HOME/${path#$root/}"
48 elif [[ -d "$path" ]]; then
49 subdir-link-r
"$root" "$path"
56 if [[ -e $dir/subdir_files
]]; then
57 subdir-link-r
$dir/subdir_files
59 local x
=( $dir/!(subdir_files|filesystem
) )
60 (( ${#x[@]} >= 1 )) ||
return 0
62 # as of this writing, it doesn't exist in /a/c, but I've used it in the past.
63 if [[ -e $dir/filesystem
&& $USER == ian
]]; then
64 sysv s
cp -R $dir/filesystem
/* /
71 common-file-setup
$dir
72 common-file-setup
$dir/machine_specific
/$HOSTNAME
76 all_dirs
=({/a
/c
,/p
/c
}{,/machine_specific
/$HOSTNAME})
77 c_dirs
=(/a
/c
{,/machine_specific
/$HOSTNAME})
80 # p needs to go first so .ssh link is created, then config link inside it
81 common-file-setup
$dir ${all_dirs[@]}
82 sudo
-u traci
"$BASH_SOURCE"
85 common-file-setup
${c_dirs[@]}
88 if ! $ROOTCMD getent passwd ian
; then
89 common-file-setup
${all_dirs[@]}
91 echo "$0: error: unexpected user"; exit 1
95 echo "$0: error: unexpected user"; exit 1