#!/bin/sh sudo systemctl stop fdmr_mon.service sudo systemctl stop http.server-fmr.service sudo systemctl disable http.server-fmr.service sudo rm -r /opt/FDMR-Monitor/ # systemctl restart apache2 sudo systemctl enable apache2 # cd /opt sudo git clone https://github.com/yuvelq/FDMR-Monitor.git cd FDMR-Monitor sudo git checkout Self_Service sudo chmod +x install.sh #sudo ./install.sh #sudo cp fdmr-mon_SAMPLE.cfg fdmr-mon.cfg sudo sed -i 's/RELOAD_TIME = 15/RELOAD_TIME = 1/' /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg #sudo cp utils/logrotate/fdmr_mon /etc/logrotate.d/ rm /etc/logrotate.d/fdmr_mon rm /lib/systemd/system/fdmr_mon.service #sudo cp utils/systemd/fdmr_mon.service /lib/systemd/system/ sudo sed -i 's/FREQUENCY = 10/FREQUENCY = 60/' /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg sudo chmod 644 /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg sed '33 a ' -i /opt/FDMR-Monitor/html/sysinfo.php #### sudo sed -i 's/localhost_2-day.png/localhost_1-day.png/' /opt/FDMR-Monitor/html/sysinfo.php cd /var/www/html/sysinfo/ #sudo sed -i 's/var\/www\/html/opt\/FDMR-Monitor\/html/' cpu.sh #sudo sed -i 's/var\/www\/html/opt\/FDMR-Monitor\/html/' graph.sh sudo sed -i "s/HBMonv2/FDMR-Monitor/g" /opt/FDMR-Monitor/sysinfo/*.sh sudo chmod +x /opt/FDMR-Monitor/sysinfo/cpu.sh sudo chmod +x /opt/FDMR-Monitor/sysinfo/graph.sh sudo chmod +x /opt/FDMR-Monitor/sysinfo/rrd-db.sh #sudo chmod +x /opt/FDMR-Monitor/updateTGIDS.sh # sudo cat > /opt/FDMR-Monitor/html/buttons.php <<- "EOF" Home   EOF # #sudo sed -i "s/opt\/FreeDMR\/freedmr.cfg/opt\/FreeDMR\/config\/FreeDMR.cfg/g" /opt/FDMR-Monitor/install.sh sudo systemctl daemon-reload sudo chmod +x /opt/extra-2.sh sudo sh /opt/extra-2.sh sudo sed -i "s/root/emqte1/g" /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg sudo sed -i "s/test/selfcare/g" /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg sudo sed -i "s/PRIVATE_NETWORK = True/PRIVATE_NETWORK = False/g" /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg sudo sed -i "s/TGID_URL =/#TGID_URL =/g" /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg sed '63 a TGID_URL = https://freedmr.cymru/talkgroups/talkgroup_ids_json.php' -i /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg sudo rm /opt/FDMR-Monitor/data/*.json cd /opt/FDMR-Monitor/ sudo rm /opt/FDMR-Monitor/install.sh wget https://raw.githubusercontent.com/hp3icc/emq-TE1ws/main/self/install.sh chmod +x /opt/FDMR-Monitor/install.sh # sh /opt/FDMR-Monitor/install.sh sudo sh /opt/extra-2.sh ##################### sudo sed -i "s/root/emqte1/g" /opt/FreeDMR/hotspot_proxy_v2.py sudo sed -i "s/test/selfcare/g" /opt/FreeDMR/hotspot_proxy_v2.py sudo sed -i "s/\/freedmr.cfg/\/config\/FreeDMR.cfg/g" /opt/FreeDMR/hotspot_proxy_v2.py sudo sed -i "s/test/selfcare/g" /opt/FreeDMR/proxy_db.py sudo sed -i "s/root/emqte1/g" /opt/FreeDMR/proxy_db.py ################# #sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh #rm /opt/FDMR-Monitor/sysinfo/*.rrd sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh #sed '33 a ' -i /var/www/html/sysinfo.php cp -r /opt/FDMR-Monitor/sysinfo/ /var/www/html/sysinfo/ #sudo rm mon.db #sudo python3 mon_db.py sudo systemctl restart proxy.service sudo systemctl restart fdmr_mon.service sudo systemctl enable fdmr_mon.service