- off
- rsync ...
- get-config
+- ssh [options]
Management commands:
- help
eval exec "${on_cmd:?}";;
"off")
eval exec "${off_cmd:?}";;
+ "ssh"|"ssh "*)
+ shift
+ # TODO: sanitize ssh arguments
+ exec ssh "$@" "${ssh_dest:?}";;
+ *)
+ die "Unsupported command";;
esac
}
# to the console. "The same user" means that we were executed by
# the same sshd process that has the lock. This is ensured by
# using SSH connection sharing on client side.
- reset | rsync | on | off)
+ reset | rsync | on | off | ssh)
ALLOWED_PPID=$(cat $RUN_DIR/ppid 2>/dev/null || :)
if [ "$PPID" -eq "${ALLOWED_PPID:-0}" ]; then run=unlocked; else run=locked; fi
$run $0 "$@";;