Minor improvements to update.sh

This commit is contained in:
Giulio 2020-09-17 16:09:01 +02:00
parent a8544908ec
commit d7c0e19f5f

View File

@ -1,10 +1,14 @@
#!/bin/sh #!/bin/sh
/bin/echo "Usage: sudo clearpassword=<password> -E update.sh" if [[ -z $clearpassword ]]; then
/bin/echo "Usage: sudo clearpassword=<password> -E update.sh"
exit 1
fi
password=`/bin/cat /etc/txtpwd` password=`/bin/cat /etc/txtpwd`
auth=`/bin/echo -n $clearpassword | /usr/bin/sha512sum | /usr/bin/cut -d' ' -f 1` 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" /bin/echo "Wrong password"
exit 1 exit 1
fi fi