#! /bin/bash sudo apt-get install rrdtool -y sudo sed -i "s/www\/html/www\/fdmr/g" /opt/FDMR-Monitor/html/*.* sudo sed -i "s/www\/html/www\/fdmr/g" /opt/FDMR-Monitor/sysinfo/*.* # Install the required support programs cd /opt/FDMR-Monitor/ apt install python3 python3-pip python3-dev libffi-dev libssl-dev cargo sed \ default-libmysqlclient-dev build-essential -y pip3 install -r requirements.txt pip install pyopenssl --upgrade cd /opt/FDMR-Monitor/ cp /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg /opt/FDMR-Monitor/fdmr-mon.cfg cd /opt/FreeDMR/ sudo systemctl stop proxy.service #sudo rm /opt/FreeDMR/hotspot_proxy_v2.py sudo rm /opt/FreeDMR/proxy_db.* #cp /opt/FDMR-Monitor/proxy/* /opt/FreeDMR/ -r cp /opt/FDMR-Monitor/proxy/hotspot_proxy_v2.py /opt/FreeDMR/hotspot_proxy_v2.py cp /opt/FDMR-Monitor/proxy/proxy.cfg /opt/FreeDMR/proxy.cfg cp /opt/FDMR-Monitor/proxy/proxy_db.py /opt/FreeDMR/proxy_db.py cd /opt/FDMR-Monitor/ wget https://www.freedmr.uk/wp-content/uploads/2021/04/favicon.ico -O /opt/FDMR-Monitor/html/favicon.ico sed '6 a ' -i /opt/FDMR-Monitor/html/index.php wget https://www.freedmr.uk/wp-content/uploads/2021/04/Free_DMR_logo_250x141_72.png -O /opt/FDMR-Monitor/html/img/logo.png ####################### if [ -d "/var/www/fdmr" ]; then rm -r /var/www/fdmr/ #echo "found file" else echo "file not found" fi mkdir /var/www/fdmr/ cp -r /opt/FDMR-Monitor/html/* /var/www/fdmr/ sudo chown www-data:www-data /var/www/fdmr/ -R cp /opt/FDMR-Monitor/utils/logrotate/fdmr_mon /etc/logrotate.d/ #cp /opt/FDMR-Monitor/utils/systemd/fdmr_mon.service /etc/systemd/system/ echo 123> /etc/systemd/system/fdmr_mon.service sudo rm /etc/systemd/system/fdmr_mon.service # cat > /opt/FDMR-Monitor/templates/main_table.html <<- "EOF"
{% if _table['SETUP']['LASTHEARD'] == True %}