Skip to content

Commit

Permalink
Merge pull request #1 from chaosdorf/set
Browse files Browse the repository at this point in the history
Add more set options.
  • Loading branch information
msteinhoff authored Sep 2, 2018
2 parents 723abaf + e5f657c commit c2bbcd0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bin/backup
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/sh
set -e
[ -z "${BACKUP_NAME}" ] && { echo "error: BACKUP_NAME not set"; exit 1; }
[ -z "${BACKUP_GPG_KEY_ID}" ] && { echo "error: BACKUP_GPG_KEY_ID not set"; exit 1; }
[ -z "${BACKUP_SSH_DESTINATION}" ] && { echo "error: BACKUP_SSH_DESTINATION not set"; exit 1; }
set -e # Exit if a command exists with an error.
set -o pipefail # If any command in a pipe exits with an error, treat the whole pipe as failed.
set -u # Fail if a variable is used, but not defined.
[ -z "${BACKUP_NAME:-}" ] && { echo "error: BACKUP_NAME not set"; exit 1; }
[ -z "${BACKUP_GPG_KEY_ID:-}" ] && { echo "error: BACKUP_GPG_KEY_ID not set"; exit 1; }
[ -z "${BACKUP_SSH_DESTINATION:-}" ] && { echo "error: BACKUP_SSH_DESTINATION not set"; exit 1; }
BACKUP_INTERVAL=${BACKUP_INTERVAL:-1h}
BACKUP_SSH_REMOTE_DIRECTORY=${BACKUP_SSH_REMOTE_DIRECTORY:-backup}

Expand Down

0 comments on commit c2bbcd0

Please sign in to comment.