diff --git a/update.sh b/update.sh index 13deb55..8706d3a 100644 --- a/update.sh +++ b/update.sh @@ -451,9 +451,11 @@ then mkdir -p /var/log/FreeDMR fi chmod +x /opt/FreeDMR/install.sh - +apt-get install python3-venv -y +python3 -m venv env0 && +source env0/bin/activate && ./install.sh - +deactivate # if [ "$(cat /opt/FreeDMR/FreeDMR-SAMPLE.cfg | grep 'TOPO_FILE')" != "" ]; then sudo sed -i 's/TOPO_FILE:.*/TOPO_FILE: topography.json/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg @@ -675,8 +677,11 @@ sudo sed -i "s/www\/html/www\/fdmr/g" /opt/FDMR-Monitor/sysinfo/*.* # Install the required support programs sudo -H pip3 install --upgrade pip +apt-get install python3-venv -y +python3 -m venv env0 && +source env0/bin/activate && pip3 install -r requirements.txt - +deactivate pip install pyopenssl --upgrade cd /opt/FDMR-Monitor/ cp /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg /opt/FDMR-Monitor/fdmr-mon.cfg @@ -1003,6 +1008,8 @@ if [ -f "mon.db" ] then rm mon.db fi +python3 -m venv env0 && +source env0/bin/activate && mysql -u root -e "DROP TABLE IF EXISTS hbmon.last_heard;" && mysql -u root -e "DROP TABLE IF EXISTS hbmon.lstheard_log;" && mysql -u root -e "DROP TABLE IF EXISTS hbmon.peer_ids;" && @@ -1010,8 +1017,9 @@ mysql -u root -e "DROP TABLE IF EXISTS hbmon.subscriber_ids;" && mysql -u root -e "DROP TABLE IF EXISTS hbmon.talkgroup_ids;" && mysql -u root -e "DROP TABLE IF EXISTS hbmon.tg_count;" cd /opt/FDMR-Monitor -python3 mon_db.py --create -python3 mon_db.py --update +python3 mon_db.py --create && +python3 mon_db.py --update && +deactivate systemctl stop apache2 systemctl disable apache2 @@ -1191,9 +1199,11 @@ sudo git clone https://github.com/CS8ABG/FDMR-Monitor.git /opt/FDMR-Monitor2 cd /opt/FDMR-Monitor2 sudo git checkout Self_Service sudo -H pip3 install --upgrade pip - +apt-get install python3-venv -y +python3 -m venv env0 && +source env0/bin/activate && pip3 install -r requirements.txt - +deactivate pip install pyopenssl --upgrade chmod 777 /opt/FDMR-Monitor2/data @@ -1273,6 +1283,8 @@ if [ -f "mon.db" ] then rm mon.db fi +python3 -m venv env0 && +source env0/bin/activate && mysql -u root -e "DROP TABLE IF EXISTS hbmon.last_heard;" && mysql -u root -e "DROP TABLE IF EXISTS hbmon.lstheard_log;" && mysql -u root -e "DROP TABLE IF EXISTS hbmon.peer_ids;" && @@ -1280,9 +1292,9 @@ mysql -u root -e "DROP TABLE IF EXISTS hbmon.subscriber_ids;" && mysql -u root -e "DROP TABLE IF EXISTS hbmon.talkgroup_ids;" && mysql -u root -e "DROP TABLE IF EXISTS hbmon.tg_count;" cd /opt/FDMR-Monitor2 -python3 mon_db.py --create -python3 mon_db.py --update - +python3 mon_db.py --create && +python3 mon_db.py --update && +deactivate #####################################