From ab5e77cb5bbba54dd5ec731185f63c14ff72b6ad Mon Sep 17 00:00:00 2001 From: Marco Kundt Date: Sun, 14 Feb 2021 11:45:15 +0100 Subject: [PATCH] let restic fail if unavailable --- restic/.bin/restic_common | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/restic/.bin/restic_common b/restic/.bin/restic_common index 38bbfe1..bf55826 100755 --- a/restic/.bin/restic_common +++ b/restic/.bin/restic_common @@ -18,7 +18,7 @@ read_config() { #B2_ACCOUNT_ID="ID" #B2_ACCOUNT_KEY="KEY" - if [[ ! -f "/etc/restic/env" && ! -f "$HOME/.config/restic/env" && ! -f "./env" ]]; then + if [[ ! -f "/etc/restic/env" && ! -f "$HOME/.config/restic/env" ]]; then echo "no config provided" exit 1 fi @@ -35,22 +35,12 @@ if pgrep -x "restic" &> /dev/null; then fi echo "Done" -info "Testing connection..." -ping -c 3 192.168.178.100 &> /dev/null - -if [[ $? > 0 ]]; then - - ping -c 3 10.0.1.3 &> /dev/null - - if [[ $? > 0 ]]; then - info "Not connected." - exit 1 - fi - BACKUP_SERVER="10.0.1.3" -fi -BACKUP_SERVER="192.168.178.100" info "Updating restic..." restic self-update echo "Done" -read_config \ No newline at end of file +info "60s delay (in case we just woke up)..." +sleep 60 +echo "Done" + +read_config