backuprunner/scripts/backupserver-shutdown.sh
2025-01-13 21:57:34 +00:00

17 lines
288 B
Bash
Executable file

#!/usr/bin/env bash
backup_host="rex.do.netdeneb.com"
backup_user="backupuser"
err_report() {
echo "Error on line $1"
exit 255
}
trap 'err_report $LINENO' ERR
ssh() {
/usr/bin/env -S ssh -o PasswordAuthentication=no "$@"
}
ssh "$backup_user"@"$backup_host" sudo poweroff