[[ -w . ]] || return 0
if [[ ! -L etc/mtab ]] ; then
- rm -f etc/mtab
- ln -sf /proc/mounts etc/mtab
+ ln -sfT /proc/mounts etc/mtab
fi
- local f
+ local f dst
local etc=(
hosts
locale.gen
for f in \
$(printf 'etc/%s ' "${etc[@]}") \
; do
- if [ -e "/${f}" ] ; then
- cp /${f} ${f}
+ if [[ -e /${f} ]] ; then
+ cp "/${f}" "${f}"
fi
done
for f in "${home[@]}" ; do
- cp "${HOME}/${f}" "root/${f}"
+ df="root/${f}"
+ f="${HOME}/${f}"
+ if [[ -e ${f} ]] ; then
+ cp "${f}" "${df}"
+ fi
done
- cat ~/.profile.d/aliases.sh > root/.bash_profile
+
+ f="${HOME}/.profile.d/aliases.sh"
+ if [[ -e ${f} ]] ; then
+ cat "${f}" > root/.bash_profile
+ fi
}
usage() {