Update pialert_install.sh

This commit is contained in:
pucherot
2021-04-11 20:54:21 +02:00
parent e6fb1ca2b2
commit 6eb35caea8

View File

@@ -38,6 +38,8 @@
USE_PYTHON_VERSION=0
PYTHON_BIN=python
FIRST_SCAN_KNOWN=true
REPORT_MAIL=False
REPORT_TO=user@gmail.com
@@ -104,7 +106,7 @@ ask_config() {
PIHOLE_INSTALL=false
if $PIHOLE_ACTIVE ; then
msgbox "Pi-hole is already installed in this system." \
"Perfect: Pi-hole Installation not necessary"
"Perfect: Pi-hole Installation is not necessary"
else
ask_yesno "Pi-hole is not installed." \
"Do you want to install Pi-hole before installing Pi.Alert ?" "YES"
@@ -167,6 +169,11 @@ ask_config() {
USE_PYTHON_VERSION=$ANSWER
fi
# Ask first scan options
ask_yesno "First Scan options" \
"Do you want to mark the new devices as known devices during the first scan?" "YES"
FIRST_SCAN_KNOWN=$ANSWER
# Ask e-mail notification config
MAIL_REPORT=false
ask_yesno "Pi.Alert can notify you by e-mail when a network event occurs" \
@@ -499,16 +506,22 @@ set_pialert_parameter() {
test_pialert() {
print_msg "- Testing Pi.Alert HW vendors database update process..."
print_msg "*** PLEASE WAIT A COUPLE OF MINUTES..."
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py update_vendors_silent 2>&1 | tee -ai "$LOG"
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py update_vendors_silent 2>&1 | tee -ai "$LOG"
echo ""
print_msg "- Testing Pi.Alert Internet IP Lookup..."
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py internet_IP 2>&1 | tee -ai "$LOG"
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py internet_IP 2>&1 | tee -ai "$LOG"
echo ""
print_msg "- Testing Pi.Alert Network scan..."
print_msg "*** PLEASE WAIT A COUPLE OF MINUTES..."
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py 1 2>&1 | tee -ai "$LOG"
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py 1 2>&1 | tee -ai "$LOG"
if $FIRST_SCAN_KNOWN ; then
echo ""
print_msg "- Set devices as Known devices..."
sqlite3 $PIALERT_HOME/db/pialert.db "UPDATE Devices SET dev_NewDevice=0, dev_AlertEvents=0" 2>&1 >> "$LOG"
fi
}
# ------------------------------------------------------------------------------