[[ $EUID == 0 ]] || exec sudo "$BASH_SOURCE" "$@"
if test -e /q/root/.ssh; then
- /a/exe/lnf /q/root/.ssh /root
+ dest=/q/root/.ssh
+ /a/exe/lnf $dest /root
else
+ dest=/root/.ssh
mkdir -p /root/.ssh
chmod 700 /root/.ssh
fi
# -t times, so it won't rewrite the file every time,
# -L resolve links
-rsync -rtL $(eval echo ~${SUDO_USER:-$USER})/.ssh /root
+rsync -rtL $(eval echo ~${SUDO_USER:-$USER})/.ssh $dest
chown -R root:root /root/.ssh