Remove '-w' as macOS doesn't have it. Fix var expansion in dash.

Signed-off-by: Aaron Bieber <aaron@bolddaemon.com>
This commit is contained in:
Aaron Bieber 2019-11-12 16:43:15 -07:00
parent 9dcc647656
commit 1830a19b37
No known key found for this signature in database
GPG Key ID: 279160AB1BE1236B
2 changed files with 3 additions and 3 deletions

View File

@ -48,10 +48,10 @@ FILES_TO_BACKUP="/root/brain.nn \
/home/pi/.bashrc \ /home/pi/.bashrc \
/home/pi/.profile" /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." echo "@ unit ${UNIT_HOSTNAME} can't be reached, make sure it's connected and a static IP assigned to the USB interface."
exit 1 exit 1
} }
echo "@ backing up $UNIT_HOSTNAME to $OUTPUT ..." 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"

View File

@ -44,7 +44,7 @@ fi
# username to use for ssh # username to use for ssh
USERNAME=${USERNAME:-pi} 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." echo "@ unit ${UNIT_HOSTNAME} can't be reached, make sure it's connected and a static IP assigned to the USB interface."
exit 1 exit 1
} }