Merge pull request #18 from fbartels/master

define an empty default if RESTIC_ARGS is not set
This commit is contained in:
Alexander Rust 2018-09-16 16:31:40 +02:00 committed by GitHub
commit 55c40c9bc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,8 @@ handle_params () {
do_monitor $@
else
shift 1
# define an empty default if RESTIC_ARGS is not set
RESTIC_ARGS=${RESTIC_ARGS:-""}
$RESTIC $RESTIC_ARGS $@
fi
}
@ -83,6 +85,8 @@ do_monitor () {
WARN=$4
CRIT=$5
# define an empty default if RESTIC_ARGS is not set
RESTIC_ARGS=${RESTIC_ARGS:-""}
SNAPS=`$RESTIC $RESTIC_ARGS snapshots --compact --no-lock -H $3`
# Get last line and parse into variables. Removes header and is empty when no snapshot exists for host
LAST=`sed 1,2d <<< $SNAPS | head -n -2 | tail -n 1`