From 3bb807e24ff8a6d8f7bc6bef18766237cf2cfaaf Mon Sep 17 00:00:00 2001 From: Esteban Mackay Q Date: Thu, 27 Jul 2023 07:29:34 -0500 Subject: [PATCH] update --- install.sh | 15 +++++++++++++-- update.sh | 30 +++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 1368ba6..fa33101 100644 --- a/install.sh +++ b/install.sh @@ -762,6 +762,11 @@ sed -i "s/THEME_COLOR = .*/THEME_COLOR = pro/g" /opt/FDMR-Monitor/fdmr-mon.cfg #sed -i "s/SUBSCRIBER_URL = .*/SUBSCRIBER_URL = https:\/\/freedmr-lh.gb7fr.org.uk\/json\/subscriber_ids.json/g" /opt/FDMR-Monitor/fdmr-mon.cfg #sed -i "s/TGID_URL = .*/TGID_URL = https:\/\/freedmr.cymru\/talkgroups\/talkgroup_ids_json.php/g" /opt/FDMR-Monitor/fdmr-mon.cfg +if [ -f "mon.db" ] +then + rm mon.db +fi + python3 mon_db.py --create python3 mon_db.py --update @@ -951,8 +956,14 @@ sed -i "s/ExecStart=.*/ExecStart=python3 \/opt\/FDMR-Monitor2\/monitor.py/g" /op sudo cp /opt/FDMR-Monitor2/utils/logrotate/fdmr_mon2 /etc/logrotate.d/fdmr_mon2 sudo cp /opt/FDMR-Monitor2/utils/systemd/fdmr_mon2.service /lib/systemd/system/fdmr_mon2.service -sudo rm mon.db -sudo python3 mon_db.py +#sudo rm mon.db +if [ -f "mon.db" ] +then + rm mon.db +fi + +python3 mon_db.py --create +python3 mon_db.py --update cat > /lib/systemd/system/http.server-fdmr2.service <<- "EOF" [Unit] diff --git a/update.sh b/update.sh index 25a49ae..5d98721 100644 --- a/update.sh +++ b/update.sh @@ -870,6 +870,18 @@ sudo sed -i "s/THEME_COLOR = .*/THEME_COLOR = pro/g" /opt/FDMR-Monitor/fdmr-mon. #sudo sed -i "s/SUBSCRIBER_URL = .*/SUBSCRIBER_URL = https:\/\/freedmr-lh.gb7fr.org.uk\/json\/subscriber_ids.json/g" /opt/FDMR-Monitor/fdmr-mon.cfg #sudo sed -i "s/TGID_URL = .*/TGID_URL = https:\/\/freedmr.cymru\/talkgroups\/talkgroup_ids_json.php/g" /opt/FDMR-Monitor/fdmr-mon.cfg +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS last_heard;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS lstheard_log;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS peer_ids;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS subscriber_ids;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS talkgroup_ids;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS tg_count;" + +if [ -f "mon.db" ] +then + rm mon.db +fi + python3 mon_db.py --create python3 mon_db.py --update @@ -1020,8 +1032,21 @@ sed -i "s/ExecStart=.*/ExecStart=python3 \/opt\/FDMR-Monitor2\/monitor.py/g" /op sudo cp /opt/FDMR-Monitor2/utils/logrotate/fdmr_mon2 /etc/logrotate.d/fdmr_mon2 sudo cp /opt/FDMR-Monitor2/utils/systemd/fdmr_mon2.service /lib/systemd/system/fdmr_mon2.service -#sudo rm mon.db -sudo python3 mon_db.py + +if [ -f "mon.db" ] +then + rm mon.db +fi + +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS last_heard;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS lstheard_log;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS peer_ids;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS subscriber_ids;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS talkgroup_ids;" +mysql -u "root" "selfcare" -e "DROP TABLE IF EXISTS tg_count;" + +python3 mon_db.py --create +python3 mon_db.py --update cat > /lib/systemd/system/http.server-fdmr2.service <<- "EOF" [Unit] @@ -1053,7 +1078,6 @@ then sudo systemctl disable http.server-fdmr.service fi if ! systemctl status http.server-fdmr2.service | grep "service; enabled;" >/dev/null 2>&1; then sudo systemctl enable http.server-fdmr2.service - fi if systemctl status fdmr_mon.service |grep "service; enabled;" >/dev/null 2>&1 then sudo systemctl disable fdmr_mon.service