From 1116b6082ca00f1ad6bd614fc55876753e3a7963 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Tue, 14 Jun 2022 11:10:44 +0200 Subject: [PATCH] ebackup - Adapt to new sequencer options --- seqs/ebackup.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/seqs/ebackup.sh b/seqs/ebackup.sh index c94b443..d4dad9a 100755 --- a/seqs/ebackup.sh +++ b/seqs/ebackup.sh @@ -68,7 +68,7 @@ step_1() { echo " [I] Running backup profile [$seq_profileName]" - if [ "${dupArgs[0]}" != "full" ] && [ ! -z "$EBU_MAX_FULLBKP_AGE" ] ; then + if [ "${dupArgs[0]:-}" != "full" ] && [ ! -z "$EBU_MAX_FULLBKP_AGE" ] ; then dupArgs+=(--full-if-older-than "$EBU_MAX_FULLBKP_AGE") fi if [ ! -z "$EBU_VOLSIZE" ] ; then @@ -77,7 +77,7 @@ step_1() { checkInstalled setPassphrase - exe $toolBin "${dupArgs[@]}" "$EBU_SOURCE" "$EBU_TARGET" + exe $toolBin "${dupArgs[@]:-}" "${EBU_SOURCE:?}" "${EBU_TARGET:?}" retVal=$? unsetPassphrase @@ -192,9 +192,7 @@ step_20_alias() { echo 'status'; } step_20() { shift local ebuTarget="$EBU_TARGET" - if [ -n "${1:-}" ] ; then - ebuTarget="$1" - fi + [[ -n "${1:-}" ]] && ebuTarget="$1" checkInstalled exe $toolBin collection-status "$ebuTarget" @@ -288,7 +286,7 @@ step_100() { } setPassphrase() { - if [ -z $PASSPHRASE ] && [ ! -z $EBU_PASSPHRASE ] ; then + if [ -z "${PASSPHRASE:-}" ] && [ ! -z "${EBU_PASSPHRASE:-}" ] ; then export PASSPHRASE="$EBU_PASSPHRASE" fi } @@ -299,7 +297,7 @@ unsetPassphrase() { checkFileHead() { local readChar - if [ ! -e "$1" ] ; then + if [ ! -e "${1:-}" ] ; then error -e "File $1 not found" return 1 fi @@ -311,7 +309,7 @@ checkFileHead() { } syslogEntry() { - if [ "$EBU_SYSLOG" == "true" ] ; then + if [[ "${EBU_SYSLOG:-}" == "true" ]] ; then exe logger -t $toolSyslogTag "$@" fi } @@ -322,7 +320,7 @@ checkInstalled() { if [ $? -ne 0 ] ; then step install fi - toolBin="$EBU_PRECMD $(command -v $toolName)" + toolBin="${EBU_PRECMD:-} $(escpath "$(command -v $toolName)")" fi }