2021-01-11 14:14:36 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-01-11 14:24:29 +01:00
|
|
|
# log command
|
2021-01-11 14:14:36 +01:00
|
|
|
if [ -n "$SSH_ORIGINAL_COMMAND" ]
|
|
|
|
then
|
2021-01-11 14:24:29 +01:00
|
|
|
echo "`/bin/date`: $SSH_ORIGINAL_COMMAND" | systemd-cat -t "ssh-wrapper.sh"
|
2021-01-11 14:14:36 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# filter commands
|
|
|
|
case "$SSH_ORIGINAL_COMMAND" in
|
|
|
|
"sha256sum /etc/machine-id")
|
|
|
|
sha256sum /etc/machine-id
|
|
|
|
;;
|
|
|
|
"find /Backups/{{hashed_machine_id.stdout}}/ -maxdepth 1 -type d")
|
|
|
|
find /Backups/{{hashed_machine_id.stdout}}/ -maxdepth 1 -type d
|
|
|
|
;;
|
|
|
|
"sudo rsync --server --sender -blogDtpre.iLsfxCIvu --backup-dir /Backups/{{hashed_machine_id.stdout}}/docker-volume-backup/diffs/current/ . /Backups/{{hashed_machine_id.stdout}}/docker-volume-backup/latest/")
|
|
|
|
sudo rsync --server --sender -blogDtpre.iLsfxCIvu --backup-dir /Backups/{{hashed_machine_id.stdout}}/docker-volume-backup/diffs/current/ . /Backups/{{hashed_machine_id.stdout}}/docker-volume-backup/latest/
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "This command is not supported."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|