Skip to content

Commit

Permalink
Remove '-w' as macOS doesn't have it. Fix var expansion in dash.
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Bieber <aaron@bolddaemon.com>
  • Loading branch information
qbit committed Nov 12, 2019
1 parent 9dcc647 commit 1830a19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 1830a19

Please sign in to comment.