From 65dcb0a6e129feabf23b29c824c276a7a4375dd9 Mon Sep 17 00:00:00 2001 From: William Douglas Date: Mon, 8 Jul 2013 13:23:31 -0700 Subject: [PATCH] Add error handling for swup failures Change-Id: Iff03c22b5fc6a80f41f47460fa1f17ae47a4d0a2 Signed-off-by: William Douglas --- system-update.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system-update.sh b/system-update.sh index 3c3a4e3..ec40cad 100755 --- a/system-update.sh +++ b/system-update.sh @@ -12,6 +12,10 @@ function system_update UPDATE=$(echo $i | sed -e 's/^[0-9]*-//') mkdir -p /var/cache/zypp/packages/$UPDATE/rpms /usr/bin/swup -i $UPDATE + if [ "$?" != 0 ]; then + echo "Update failed" + exit -1 + fi rm /var/cache/updatemanager/install/$i done -- 2.7.4