From 1830a19b37d506160c07e5675526f8c66d7795f7 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Tue, 12 Nov 2019 16:43:15 -0700 Subject: [PATCH] Remove '-w' as macOS doesn't have it. Fix var expansion in dash. Signed-off-by: Aaron Bieber --- scripts/backup.sh | 4 ++-- scripts/restore.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index 3ba9fd8b9..9c58dbd52 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -48,10 +48,10 @@ FILES_TO_BACKUP="/root/brain.nn \ /home/pi/.bashrc \ /home/pi/.profile" -ping -w 3 -c 1 "${UNIT_HOSTNAME}" > /dev/null 2>&1 || { +ping -c 1 "${UNIT_HOSTNAME}" > /dev/null 2>&1 || { echo "@ unit ${UNIT_HOSTNAME} can't be reached, make sure it's connected and a static IP assigned to the USB interface." exit 1 } echo "@ backing up $UNIT_HOSTNAME to $OUTPUT ..." -ssh "${USERNAME}@${UNIT_HOSTNAME}" "sudo find ${FILES_TO_BACKUP[@]} -print0 | xargs -0 sudo tar cv" | gzip -9 > "$OUTPUT" +ssh "${USERNAME}@${UNIT_HOSTNAME}" "sudo find ${FILES_TO_BACKUP} -print0 | xargs -0 sudo tar cv" | gzip -9 > "$OUTPUT" diff --git a/scripts/restore.sh b/scripts/restore.sh index 6303f8862..551094e9c 100755 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -44,7 +44,7 @@ fi # username to use for ssh USERNAME=${USERNAME:-pi} -ping -w 3 -c 1 "${UNIT_HOSTNAME}" > /dev/null 2>&1 || { +ping -c 1 "${UNIT_HOSTNAME}" > /dev/null 2>&1 || { echo "@ unit ${UNIT_HOSTNAME} can't be reached, make sure it's connected and a static IP assigned to the USB interface." exit 1 }