Update pialert-cli

This commit is contained in:
leiweibau
2022-08-12 14:33:11 +10:00
committed by jokob-sk
parent 65ddfd8fb2
commit 7c96059b7f
+8 -7
View File
@@ -6,17 +6,17 @@ case $1 in
help) help)
echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)" echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)"
echo "Usage: pialer-cli <command>" echo "Usage: pialert-cli <command>"
echo "" echo ""
echo "The is a list of supported commands:" echo "The is a list of supported commands:"
echo "" echo ""
echo " set_login - Set the parameter PIALERT_WEB_PROTECTION in the configfile to TRUE" echo " set_login - Set the parameter PIALERT_WEB_PROTECTION in the config file to TRUE"
echo " - If the parameter is not present, it will be created with the default password '123456'." echo " - If the parameter is not present, it will be created with the default password '123456'."
echo "" echo ""
echo " unset_login - set the parameter PIALERT_WEB_PROTECTION in the configfile to FALSE" echo " unset_login - set the parameter PIALERT_WEB_PROTECTION in the config file to FALSE"
echo " - If the parameter is not present, it will be created with the default password '123456'." echo " - If the parameter is not present, it will be created with the default password '123456'."
echo "" echo ""
echo " set_password <new_password> - set the new password as a hased value" echo " set_password <new_password> - set the new password as a hashed value"
echo "" echo ""
echo " set_autopassword - set the new random password as a hashed value and show it plaintext in the console" echo " set_autopassword - set the new random password as a hashed value and show it plaintext in the console"
echo "" echo ""
@@ -73,7 +73,8 @@ case $1 in
else else
sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_PASS_HASH'" $PIA_CONF_FILE sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_PASS_HASH'" $PIA_CONF_FILE
fi fi
echo " The new password is set" echo ""
echo "The new password is set"
;; ;;
set_autopassword) set_autopassword)
@@ -101,12 +102,12 @@ case $1 in
## Overwrite password parameter ## Overwrite password parameter
sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_AUTOPASS_HASH'" $PIA_CONF_FILE sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_AUTOPASS_HASH'" $PIA_CONF_FILE
fi fi
echo " The new password is set" echo ""
echo "The new password is set"
;; ;;
*) *)
echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)" echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)"
echo "Use \"pialert-cli help\" for a list of supported commands." echo "Use \"pialert-cli help\" for a list of supported commands."
echo ""
esac esac