From cd6dfdda403e389bd88c9beddf611e439908d933 Mon Sep 17 00:00:00 2001 From: snaki Date: Thu, 7 Jul 2022 14:13:38 +0200 Subject: [PATCH] minor fixes --- btrbk | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/btrbk b/btrbk index 0066e56..0da31d5 100755 --- a/btrbk +++ b/btrbk @@ -1,6 +1,5 @@ #!/bin/bash -source /etc/btrbk.conf startDate=$(date +%s) function bkRun { @@ -101,6 +100,7 @@ function getSnap { function testConf { + source /etc/btrbk.conf if [ -z ${rDate+x} ]; then if ! date -d "$rDate" > /dev/null 2>&1; then echo "date is in wrong format: YYYY-MM-DD" @@ -150,7 +150,7 @@ function echoHelp { exit 1 } -options=$(getopt -l "backup,force,date:,restore:,full-restore:,help" -o "bfd:r:x:h" -- "$@") +options=$(getopt -l "backup,force,date::,restore::,full-restore::,help" -o "bfd::r::x::h" -- "$@") eval set -- "$options" while true; do @@ -161,14 +161,13 @@ while true; do -r|--restore) restore=1; restoreVol=$2; shift;; -x|--full-restore) fullRestore=1; restoreDir=$2; shift;; -h|--help) Help; shift; break;; - --) shift;; + --) shift; echoHelp;; \?) echo "error"; exit 1;; - *) echoHelp; shift; break;; esac shift done - -if [ $fullRestore=1 ]; then +echo $fullRestore +if [ $fullRestore = "1" ]; then runFullRestore else testConf