Update pialert-install.sh

- redirect updates to https://github.com/leiweibau/Pi.Alert
- clean code (final)
This commit is contained in:
tteckster 2023-09-18 14:27:51 -04:00 committed by GitHub
parent 4ad7bbd884
commit c7fef220b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,6 @@ msg_ok "Installed Python Dependencies"
msg_info "Installing Pi.Alert" msg_info "Installing Pi.Alert"
curl -sL https://github.com/leiweibau/Pi.Alert/raw/main/tar/pialert_latest.tar | tar xvf - -C /opt >/dev/null 2>&1 curl -sL https://github.com/leiweibau/Pi.Alert/raw/main/tar/pialert_latest.tar | tar xvf - -C /opt >/dev/null 2>&1
mkdir -p /opt/pialert/front/reports
rm -rf /var/www/html/index.html rm -rf /var/www/html/index.html
mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old
ln -s /opt/pialert/install/index.html /var/www/html/index.html ln -s /opt/pialert/install/index.html /var/www/html/index.html
@ -69,12 +68,10 @@ dest_dir="/opt/pialert/front/php/server"
for file in pialert.vendors.log pialert.IP.log pialert.1.log pialert.cleanup.log pialert.webservices.log; do for file in pialert.vendors.log pialert.IP.log pialert.1.log pialert.cleanup.log pialert.webservices.log; do
ln -s "$src_dir/$file" "$dest_dir/$file" ln -s "$src_dir/$file" "$dest_dir/$file"
done done
git config --global --add safe.directory /opt/pialert
sed -i 's#PIALERT_PATH\s*=\s*'\''/home/pi/pialert'\''#PIALERT_PATH = '\''/opt/pialert'\''#' /opt/pialert/config/pialert.conf sed -i 's#PIALERT_PATH\s*=\s*'\''/home/pi/pialert'\''#PIALERT_PATH = '\''/opt/pialert'\''#' /opt/pialert/config/pialert.conf
sed -i 's/~/\/opt/g' /opt/pialert/install/pialert.cron sed -i 's/~/\/opt/g' /opt/pialert/install/pialert.cron
crontab /opt/pialert/install/pialert.cron crontab /opt/pialert/install/pialert.cron
cp -R /opt/pialert/install/pialert_update.sh /usr/bin/update echo "bash -c \"\$(wget -qLO - https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_update.sh)\" -s --lxc" >/usr/bin/update
sed -i 's/~/\/opt/g' /usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
echo "python3 /opt/pialert/back/pialert.py 1" >/usr/bin/scan echo "python3 /opt/pialert/back/pialert.py 1" >/usr/bin/scan
chmod +x /usr/bin/scan chmod +x /usr/bin/scan