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