From d29001ef32ec5223dc4bf085be7328cfa956c171 Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Wed, 10 Aug 2022 20:37:40 +0200 Subject: [PATCH] Add new commands to pialert-cli enable and disable arp-scan Update help commands --- back/pialert-cli | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/back/pialert-cli b/back/pialert-cli index 75ce7689..e2f9abbe 100644 --- a/back/pialert-cli +++ b/back/pialert-cli @@ -10,15 +10,28 @@ case $1 in echo "" echo "The is a list of supported commands:" echo "" - echo " set_login - Sets 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 " set_login - Sets the parameter PIALERT_WEB_PROTECTION in the config file to TRUE" + echo " - If the parameter is not present, it will be created. Additionally the" + echo " default password '123456' is set." echo "" - echo " unset_login - Sets 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 " unset_login - Sets the parameter PIALERT_WEB_PROTECTION in the config file to FALSE" + echo " - If the parameter is not present, it will be created. Additionally the" + echo " default password '123456' is set." echo "" - echo " set_password - Sets the new password as a hashed value" + echo " set_password - Sets the new password as a hashed value." + echo " - If the PIALERT_WEB_PROTECTION parameter does not exist yet, it will be" + echo " created and set to 'True' (login enabled)" echo "" - echo " set_autopassword - Sets a new random password as a hashed value and show it plaintext in the console" + echo " set_autopassword - Sets a new random password as a hashed value and show it plaintext in" + echo " the console." + echo " - If the PIALERT_WEB_PROTECTION parameter does not exist yet, it will be" + echo " created and set to 'True' (login enabled)" + echo "" + echo " disable_scan - Stops all active scans" + echo " - Prevents new scans from starting" + echo "" + echo " enable_scan - Stops all active scans" + echo " - Prevents new scans from starting" echo "" echo "" ;; @@ -106,6 +119,19 @@ case $1 in echo "The new password is set" ;; + disable_scan) + ## stop active scans + sudo killall arp-scan + touch ../db/setting_stoparpscan + echo "The arp-scan is disabled" + ;; + + enable_scan) + ## stop active scans + rm ../db/setting_stoparpscan + echo "The arp-scan is enable" + ;; + *) echo "pialert-cli v0.1 (https://github.com/leiweibau/Pi.Alert)" echo "Use \"pialert-cli help\" for a list of supported commands."