From d7c0e19f5f737bba24086337c2f3c5ed79feedaf Mon Sep 17 00:00:00 2001 From: Giulio Date: Thu, 17 Sep 2020 16:09:01 +0200 Subject: [PATCH] Minor improvements to update.sh --- update/update.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/update/update.sh b/update/update.sh index c76130a..44ca8a0 100755 --- a/update/update.sh +++ b/update/update.sh @@ -1,10 +1,14 @@ #!/bin/sh -/bin/echo "Usage: sudo clearpassword= -E update.sh" +if [[ -z $clearpassword ]]; then + /bin/echo "Usage: sudo clearpassword= -E update.sh" + exit 1 +fi + password=`/bin/cat /etc/txtpwd` auth=`/bin/echo -n $clearpassword | /usr/bin/sha512sum | /usr/bin/cut -d' ' -f 1` -if [ "$auth" != "$password" ]; then +if [[ "$auth" != "$password" ]]; then /bin/echo "Wrong password" exit 1 fi