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
24 # if we make a link back to the root, traversing the subdirs stops.
25 # This makes it so we can do subdir directories. Must call with absolute
32 targets
=( "$2"/!(.git
) )
34 for f
in "$1"/!(.git
); do
35 [[ -d $f ]] && targets
+=("$f") ||
:
38 local below
="$( readlink -f "$root/..
")"
39 for path
in "${targets[@]}"; do
40 local fullpath
="$(readlink -f "$path")"
41 #e $fullpath $below # debug
42 if [[ -f $path || $
(dirname $
(readlink
-f "$fullpath")) == "$below" ]]; then
43 sysv lnf
-T "$path" "$HOME/${path#$root/}"
44 elif [[ -d "$path" ]]; then
45 subdir-link-r
"$root" "$path"
52 if [[ -e $dir/subdir_files
]]; then
53 subdir-link-r
$dir/subdir_files
55 local x
=( $dir/!(subdir_files|filesystem
) )
56 (( ${#x[@]} >= 1 )) ||
return 0
58 # as of this writing, it doesn't exist in /a/c, but I've used it in the past.
59 if [[ -e $dir/filesystem
&& $USER == ian
]]; then
60 sysv s
cp -R $dir/filesystem
/* /
67 common-file-setup
$dir
68 common-file-setup
$dir/machine_specific
/$HOSTNAME
72 all_dirs
=({/a
/c
,/p
/c
}{,/machine_specific
/$HOSTNAME})
73 c_dirs
=(/a
/c
{,/machine_specific
/$HOSTNAME})
76 # p needs to go first so .ssh link is created, then config link inside it
77 common-file-setup
$dir ${all_dirs[@]}
78 sudo
-u traci
"$BASH_SOURCE"
81 common-file-setup
${c_dirs[@]}
84 if ! $ROOTCMD getent passwd ian
; then
85 common-file-setup
${all_dirs[@]}
87 echo "$0: error: unexpected user"; exit 1
91 echo "$0: error: unexpected user"; exit 1