From d4db662b357772a65e4f913b7da8ef87e7feae63 Mon Sep 17 00:00:00 2001 From: RaspbianProyect by HP3ICC Date: Sun, 12 Feb 2023 13:50:49 +0000 Subject: [PATCH] Update install.sh --- install.sh | 73 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 15 deletions(-) diff --git a/install.sh b/install.sh index bd33567..5aafa4c 100644 --- a/install.sh +++ b/install.sh @@ -73,6 +73,19 @@ else fi ######################## +if [ -d "/var/www" ] +then + echo "found file" +else + mkdir /var/www +fi +if [ -d "/var/www/fdmr" ] +then + echo "found file" +else + mkdir /var/www/fdmr +fi +######################## if [ -f "/opt/obp.txt" ] then echo "found file" @@ -82,18 +95,47 @@ else #Coloque abajo su lista de obp y peer EOF fi -if [ -d "/var/www" ] +###################### +if [ -f "/opt/rules.txt" ] then echo "found file" else - mkdir /var/www + sudo cat > /opt/rules.txt <<- "EOF" +BRIDGES = { + + '9990': [ + {'SYSTEM': 'EchoTest', 'TS': 2, 'TGID': 9990, 'ACTIVE':True, 'TIMEOUT': 0, 'TO_TYPE': 'NONE', 'ON': [9990], 'OFF': [], 'RESET': []}, + ], + + + +} +if __name__ == '__main__': + from pprint import pprint + pprint(BRIDGES) + + +EOF fi -if [ -d "/var/www/fdmr" ] +############ +if [ -f "/opt/extra-1.sh" ] then - echo "found file" + echo "found file" else - mkdir /var/www/fdmr + sudo cat > /opt/extra-1.sh <<- "EOF" +###################################################################### +# Coloque en este archivo, cualquier instruccion shell adicional que # +# quierre se realice al finalizar la actualizacion. # +###################################################################### + + +EOF +# +cp /opt/extra-1.sh /opt/extra-2.sh + fi +sudo chmod +x /opt/extra-* + ######################### #lamp @@ -213,6 +255,7 @@ sudo sed -i 's/ANNOUNCEMENT_LANGUAGE: en_GB/ANNOUNCEMENT_LANGUAGE: CW/' /opt/Fre #sed '37 a TGID_URL: https://freedmr.cymru/talkgroups/talkgroup_ids_json.php' -i /opt/FreeDMR/config/FreeDMR.cfg rm /opt/conf.txt +rm /opt/FreeDMR-SAMPLE.cfg cd /opt/FreeDMR/ mv loro.cfg /opt/FreeDMR/playback.cfg @@ -275,7 +318,15 @@ 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 - +############################### +sudo sed -i "s/root/emqte1/g" /opt/FDMR-Monitor/proxy/hotspot_proxy_v2.py +sudo sed -i "s/test/selfcare/g" /opt/FDMR-Monitor/proxy/hotspot_proxy_v2.py +sudo sed -i "s/\/freedmr.cfg/\/config\/FreeDMR.cfg/g" /opt/FDMR-Monitor/proxy/hotspot_proxy_v2.py +sudo sed -i "s/test/selfcare/g" /opt/FDMR-Monitor/proxy/proxy_db.py +sudo sed -i "s/root/emqte1/g" /opt/FDMR-Monitor/proxy/proxy_db.py +sudo sed -i "s/root/emqte1/g" /opt/FDMR-Monitor/proxy/proxy.cfg +sudo sed -i "s/test/selfcare/g" /opt/FDMR-Monitor/proxy/proxy.cfg +################# 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 @@ -577,15 +628,7 @@ systemctl stop apache2 systemctl disable apache2 ##################### sudo sed -i "s/All rights reserved.
.*/All rights reserved.
\"2018\") {\$cdate=\"2018-\".date(\"Y\");} echo \$cdate; ?>\" target=\"_blank\" href=https:\/\/gitlab.com\/hp3icc\/FDMR\/>Proyect: FDMR+<\/a>
/g" /var/www/fdmr/*.php -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 -# -sudo sed -i "s/root/emqte1/g" /opt/FreeDMR/proxy.cfg -sudo sed -i "s/test/selfcare/g" /opt/FreeDMR/proxy.cfg -################# + chmod +x /opt/FDMR-Monitor/sysinfo/* sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh (crontab -l; echo "*/5 * * * * sh /opt/FDMR-Monitor/sysinfo/graph.sh")|awk '!x[$0]++'|crontab -