mirror of https://gitlab.com/hp3icc/emq-TE1.git
117 lines
3.8 KiB
Bash
117 lines
3.8 KiB
Bash
#!/bin/sh
|
|
rm -r /opt/HBMonv2/
|
|
cd /opt
|
|
git clone https://github.com/yuvelq/FDMR-Monitor.git
|
|
mv /opt/FDMR-Monitor /opt/HBMonv2
|
|
cd HBMonv2
|
|
sudo chmod +x install.sh
|
|
sudo ./install.sh
|
|
cp config_SAMPLE.py config.py
|
|
sudo chmod +x /opt/HBMonv2/monitor.py
|
|
sudo sed -i 's/FREQUENCY = 10/FREQUENCY = 60/' /opt/HBMonv2/config.py
|
|
#
|
|
sudo cat > /opt/HBMonv2/updateTGIDS.sh <<- "EOF"
|
|
#!/bin/bash
|
|
#sleep $[ ( $RANDOM % 1800 ) + 1 ]s
|
|
cd /opt/HBMonv2
|
|
FILE_NAME="talkgroup_ids.json"
|
|
#FETCH_URL="http://downloads.freedmr.uk/downloads/talkgroup_ids.json"
|
|
FETCH_URL="https://freedmr.cymru/talkgroups/talkgroup_ids_json.php"
|
|
OLD_MD5=`md5sum ${FILE_NAME}`
|
|
wget -O ${FILE_NAME} ${FETCH_URL}
|
|
NEW_MD5=`md5sum ${FILE_NAME}`
|
|
if [ "$NEW_MD5" != "$OLD_MD5" ]
|
|
then
|
|
echo "File is new, restarting"
|
|
sync ; echo 3 > /proc/sys/vm/drop_caches && sudo systemctl restart hbmon2.service
|
|
fi
|
|
EOF
|
|
####
|
|
sudo sed -i 's/localhost_2-day.png/localhost_1-day.png/' /opt/HBMonv2/html/sysinfo.php
|
|
cd /opt/HBMonv2/sysinfo/
|
|
sudo sed -i 's/var\/www\/html/opt\/HBMonv2\/html/' cpu.sh
|
|
sudo sed -i 's/var\/www\/html/opt\/HBMonv2\/html/' graph.sh
|
|
|
|
sudo chmod +x /opt/HBMonv2/sysinfo/cpu.sh
|
|
sudo chmod +x /opt/HBMonv2/sysinfo/graph.sh
|
|
sudo chmod +x /opt/HBMonv2/sysinfo/rrd-db.sh
|
|
sudo sh /opt/HBMonv2/sysinfo/rrd-db.sh
|
|
sudo chmod +x /opt/HBMonv2/updateTGIDS.sh
|
|
|
|
sudo cat > /opt/HBMonv2/html/buttons.html <<- "EOF"
|
|
<!-- HBMonitor buttons HTML code -->
|
|
<a class="button" href="index.php"> Home </a>
|
|
<!--
|
|
|
|
<div class="dropdown">
|
|
<button class="dropbtn"> Admin Area </button>
|
|
<div class="dropdown-content">
|
|
<a href="masters.php"> Masters </a>
|
|
<a href="peers.php"> Peers </a>
|
|
<a href="opb.php"> OpenBridge </a>
|
|
<a href="bridges.php"> Bridges </a>
|
|
<a href="moni.php"> Monitor </a>
|
|
<a href="sinfo.php"> System Info </a>
|
|
</div>
|
|
</div>
|
|
-->
|
|
|
|
<a class="button" href="linkedsys.php"> Linked Systems </a>
|
|
|
|
<a class="button" href="opb.php"> OpenBridge </a>
|
|
|
|
<a class="button" href="statictg.php"> Static TG </a>
|
|
|
|
<a class="button" href="moni.php"> Monitor </a>
|
|
|
|
<a class="button" href="sysinfo.php"> System Info </a>
|
|
|
|
<a class="button" href="log.php"> Lastheard </a>
|
|
</div>
|
|
|
|
<a class="button" href="http://www.freedmr.uk/index.php/why-use-freedmr/"target="_blank"> Info FreeDMR </a>
|
|
|
|
<a class="button" href="http://www.freedmr.uk/index.php/freedmr-servers/"target="_blank"> Info Server </a>
|
|
|
|
<a class="button" href="http://repeater.uk.freedmr.link/status/server_status.php"target="_blank"> Status Server </a>
|
|
|
|
<a class="button" href="http://repeater.uk.freedmr.link/status/count.php"target="_blank"> Ranking TG </a>
|
|
|
|
<a class="button" href="http://www.freedmr.uk/freedmr/option-calculator-b.php"target="_blank"> Static TG Calculator </a>
|
|
|
|
<!--
|
|
|
|
<a class="button" href="bridges.php"> Bridges </a>
|
|
-->
|
|
<!-- Own buttons HTML code -->
|
|
|
|
<!-- Example of buttons dropdown HTML code -->
|
|
<!--
|
|
<p></p>
|
|
<div class="dropdown">
|
|
<button class="dropbtn">Admin Area</button>
|
|
<div class="dropdown-content">
|
|
<a href="masters.php">Master&Peer</a>
|
|
<a href="opb.php">OpenBridge</a>
|
|
<a href="moni.php">Monitor</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="dropdown">
|
|
<button class="dropbtn">Reflectors</button>
|
|
<div class="dropdown-content">
|
|
<a target='_blank' href="#">YSF Reflector</a>
|
|
<a target='_blank' href="#">XLX950</a>
|
|
</div>
|
|
</div>
|
|
-->
|
|
EOF
|
|
#
|
|
sudo systemctl stop hbmon2.service
|
|
sudo rm /opt/HBMonv2/*.json
|
|
sudo rm /opt/HBMonv2/sysinfo/*.rrd
|
|
sudo sh /opt/HBMonv2/sysinfo/rrd-db.sh
|
|
#sudo systemctl start http.server-fmr.service
|
|
sudo sh /opt/HBMonv2/updateTGIDS.sh
|
|
sudo sh /opt/extra-1.sh
|