From 0ad6e887acc55f46e08a9e20122d37ae8d076718 Mon Sep 17 00:00:00 2001
From: Ciara Brennan <ciara.brennan@gmail.com>
Date: Mon, 28 Oct 2019 11:49:24 +0000
Subject: [PATCH] check zip is installed first

Signed-off-by: Ciara Brennan <ciara.brennan@gmail.com>
---
 scripts/backup.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/backup.sh b/scripts/backup.sh
index 85b53e0..281a2bb 100755
--- a/scripts/backup.sh
+++ b/scripts/backup.sh
@@ -19,6 +19,11 @@ FILES_TO_BACKUP=(
   /home/pi/.bashrc
 )
 
+if ! type "zip" >/dev/null 2>&1; then
+  echo "This script requires zip, please resolve and try again"
+  exit 1
+fi
+
 ping -c 1 "${UNIT_HOSTNAME}" >/dev/null || {
   echo "@ unit ${UNIT_HOSTNAME} can't be reached, make sure it's connected and a static IP assigned to the USB interface."
   exit 1