From 4ab1de4fa2aad66f9cf7f6cf158b3f29620d8587 Mon Sep 17 00:00:00 2001
From: Esteban Mackay Q <49044505+hp3icc@users.noreply.github.com>
Date: Sat, 11 Feb 2023 10:20:29 -0500
Subject: [PATCH] Add files via upload
---
README.md | 298 ++++-----
fdmr-update.sh | 392 ++++++------
install.sh | 1331 +++++++++++++++++++++--------------------
menu.sh | 96 +--
selfservice-update.sh | 391 ++++++------
update.sh | 207 ++++---
6 files changed, 1358 insertions(+), 1357 deletions(-)
diff --git a/README.md b/README.md
index 4ac2e5a..74ace56 100644
--- a/README.md
+++ b/README.md
@@ -1,149 +1,149 @@
-# Easy-FreeDMR-SERVER-Install
-
-
-
-is an excerpt from the emq-TE1ws proyect, focused on new and current sysops who want to install FreeDMR easily, quickly and up-to-date.
-
-this shell, install FreeDMR Server and FDMR-Monitor
-
-#
-
-Shell easy auto install FreeDMR Server version Self-Service without Docker, latest original gitlab hacknix version by G7RZU Simon, with Dashboard by OA4DOA, template mods by WP3JM James & N6DOZ Rudy, Self-Service mods with Dial-TG by IU2NAF Diego and menu by HP3ICC.
-
-# Important note , Unofficial script to install Freedmr Server with Dashboard self-service, if you require support from the official version of the developer , refer to the original developer script :
-
-https://gitlab.hacknix.net/hacknix/FreeDMR/-/wikis/Installing-using-Docker-(recommended!)
-
-FreeDMR Server original version gitlab FreeDMR by G7RZU hacknix Simon.
-
-#
-
-# Pre-Requirements
-
-need have curl and sudo installed
-
-#
-
-# Install
-
-into your ssh terminal copy and paste the following link :
-
- apt-get update
- apt-get install curl sudo -y
-
- sh -c "$(curl -fsSL https://github.com/hp3icc/Easy-FreeDMR-SERVER/raw/main/install.sh)"
-
-
- #
-
- # Menu
-
- 
-
- At the end of the installation your freedmr server will be installed and working, a menu will be displayed that will make it easier for you to edit, restart or update your server and dashboard to future versions.
-
- to use the options menu, just type menu in your ssh terminal or console.
-
- #
-
- # Self-Service
-
- 
-
- The self-service feature, added by fellow OA4DOA Christian, allows each user to add or remove one or more static tgs from the ease of a graphical environment from the server's Dashboard.
-
- Thanks to colleague IU2NAF Diego and the FreeDMR Italia team, they add Dial-TG compatibility and option to customize the language of the announcement voice or use CW.
-
- # Self-Service database
-
- The Self-Service function uses a local database, this database does not store private information, it only stores the callsign, id and list of static tgs, created by the same user, the password is the callsign that the hotspot has and The password is decided by the user from his hotspot in the options line, without sending a previous request, filling out a ticket, sending an email or asking someone else for authorization. The user can configure the same password for all their hotspots, repeaters or connections, or they can configure an independent password for each connected equipment. They can only use Self-Service if they have previously configured their password in the options line and their equipment or application. is connected to the server
-
- #
-
- # Self-Service username and password
-
- The user will always be indicative that he has his hotspot or application connected to the server.
-
-the password is chosen by the user and placed in the options line as follows: " PASS=password_of user_selfservice"
-
-Password example " abc123 " :
-
-Options=PASS=abc123
-
-
-
- The password must contain at least 6 characters between letters and numbers, you cannot use your callsign as a password.
-
-
- #
-
- # Server startup
-
-To integrate your server to the freedmr network, you must contact the telegram group
-
- * https://t.me/FreeDMR_Building_Server_Support
-
- #
-
- #
-
- # Location files config :
-
- * FreeDMR Server:
-
- /opt/FreeDMR/config/FreeDMR.cfg
-
- * FreeDMR Rules:
-
- /opt/FreeDMR/config/FreeDMR.cfg
-
- * FDMR-Monitor:
-
- /opt/FDMR-Monitor/fdmr-mon.cfg
-
- #
-
- # Systemctl Services :
-
- * Freedmr:
-
- freedmr.service
-
- * FreeDMR Proxy:
-
- proxy.service
-
- * FreeDMR Parrot:
-
- fdmrparrot.service
-
- * FDMR-Monitor:
-
- fdmr_mon.service
-
- * Web Server
-
- http.server-fdmr.service
-
- #
-
- # Dashboard Files
-
- /var/www/fdmr/
-
-#
-
- # Sources :
-
- * https://gitlab.hacknix.net/hacknix/FreeDMR
-
- * http://www.freedmr.uk/index.php/freedmr-server-install/
-
- * https://github.com/yuvelq/FDMR-Monitor/tree/Self_Service
-
- * https://www.daniloaz.com/es/como-crear-un-usuario-en-mysql-mariadb-y-concederle-permisos-para-una-base-de-datos-desde-la-linea-de-comandos/
-
- * https://www.tecmint.com/install-lamp-debian-11/
-
- * https://styde.net/crear-una-base-de-datos-en-mysql-mariadb/
-
+# Easy-FreeDMR-SERVER-Install
+
+
+
+is an excerpt from the emq-TE1ws proyect, focused on new and current sysops who want to install FreeDMR easily, quickly and up-to-date.
+
+this shell, install FreeDMR Server and FDMR-Monitor
+
+#
+
+Shell easy auto install FreeDMR Server version Self-Service without Docker, latest original gitlab hacknix version by G7RZU Simon, with Dashboard by OA4DOA, template mods by WP3JM James & N6DOZ Rudy, Self-Service mods with Dial-TG by IU2NAF Diego and menu by HP3ICC.
+
+# Important note , Unofficial script to install Freedmr Server with Dashboard self-service, if you require support from the official version of the developer , refer to the original developer script :
+
+https://gitlab.hacknix.net/hacknix/FreeDMR/-/wikis/Installing-using-Docker-(recommended!)
+
+FreeDMR Server original version gitlab FreeDMR by G7RZU hacknix Simon.
+
+#
+
+# Pre-Requirements
+
+need have curl and sudo installed
+
+#
+
+# Install
+
+into your ssh terminal copy and paste the following link :
+
+ apt-get update
+ apt-get install curl sudo -y
+
+ sh -c "$(curl -fsSL https://github.com/hp3icc/Easy-FreeDMR-SERVER/raw/main/install.sh)"
+
+
+ #
+
+ # Menu
+
+ 
+
+ At the end of the installation your freedmr server will be installed and working, a menu will be displayed that will make it easier for you to edit, restart or update your server and dashboard to future versions.
+
+ to use the options menu, just type menu in your ssh terminal or console.
+
+ #
+
+ # Self-Service
+
+ 
+
+ The self-service feature, added by fellow OA4DOA Christian, allows each user to add or remove one or more static tgs from the ease of a graphical environment from the server's Dashboard.
+
+ Thanks to colleague IU2NAF Diego and the FreeDMR Italia team, they add Dial-TG compatibility and option to customize the language of the announcement voice or use CW.
+
+ # Self-Service database
+
+ The Self-Service function uses a local database, this database does not store private information, it only stores the callsign, id and list of static tgs, created by the same user, the password is the callsign that the hotspot has and The password is decided by the user from his hotspot in the options line, without sending a previous request, filling out a ticket, sending an email or asking someone else for authorization. The user can configure the same password for all their hotspots, repeaters or connections, or they can configure an independent password for each connected equipment. They can only use Self-Service if they have previously configured their password in the options line and their equipment or application. is connected to the server
+
+ #
+
+ # Self-Service username and password
+
+ The user will always be indicative that he has his hotspot or application connected to the server.
+
+the password is chosen by the user and placed in the options line as follows: " PASS=password_of user_selfservice"
+
+Password example " abc123 " :
+
+Options=PASS=abc123
+
+
+
+ The password must contain at least 6 characters between letters and numbers, you cannot use your callsign as a password.
+
+
+ #
+
+ # Server startup
+
+To integrate your server to the freedmr network, you must contact the telegram group
+
+ * https://t.me/FreeDMR_Building_Server_Support
+
+ #
+
+ #
+
+ # Location files config :
+
+ * FreeDMR Server:
+
+ /opt/FreeDMR/config/FreeDMR.cfg
+
+ * FreeDMR Rules:
+
+ /opt/FreeDMR/config/FreeDMR.cfg
+
+ * FDMR-Monitor:
+
+ /opt/FDMR-Monitor/fdmr-mon.cfg
+
+ #
+
+ # Systemctl Services :
+
+ * Freedmr:
+
+ freedmr.service
+
+ * FreeDMR Proxy:
+
+ proxy.service
+
+ * FreeDMR Parrot:
+
+ fdmrparrot.service
+
+ * FDMR-Monitor:
+
+ fdmr_mon.service
+
+ * Web Server
+
+ http.server-fdmr.service
+
+ #
+
+ # Dashboard Files
+
+ /var/www/fdmr/
+
+#
+
+ # Sources :
+
+ * https://gitlab.hacknix.net/hacknix/FreeDMR
+
+ * http://www.freedmr.uk/index.php/freedmr-server-install/
+
+ * https://github.com/yuvelq/FDMR-Monitor/tree/Self_Service
+
+ * https://www.daniloaz.com/es/como-crear-un-usuario-en-mysql-mariadb-y-concederle-permisos-para-una-base-de-datos-desde-la-linea-de-comandos/
+
+ * https://www.tecmint.com/install-lamp-debian-11/
+
+ * https://styde.net/crear-una-base-de-datos-en-mysql-mariadb/
+
diff --git a/fdmr-update.sh b/fdmr-update.sh
index 74703ad..78cdf2d 100644
--- a/fdmr-update.sh
+++ b/fdmr-update.sh
@@ -1,201 +1,191 @@
-#!/bin/bash
-cd /
-variable=$(grep "SERVER_ID:" /opt/FreeDMR/config/FreeDMR.cfg | tail -c 5)
-sudo systemctl stop freedmr.service
-sudo systemctl stop proxy.service
-sudo systemctl stop fdmrparrot.service
-rm -r /opt/FreeDMR
-cd /opt
-git clone https://gitlab.hacknix.net/hacknix/FreeDMR.git
-cd FreeDMR
-mkdir config
-mkdir /var/log/FreeDMR
-chmod +x /opt/FreeDMR/install.sh
-./install.sh
-#
-cat > /usr/local/bin/cronedit.sh <<- "EOF"
-cronjob_editor () {
-# usage: cronjob_editor '' ''
-if [[ -z "$1" ]] ;then printf " no interval specified\n" ;fi
-if [[ -z "$2" ]] ;then printf " no command specified\n" ;fi
-if [[ -z "$3" ]] ;then printf " no action specified\n" ;fi
-if [[ "$3" == add ]] ;then
- # add cronjob, no duplication:
- ( sudo crontab -l | grep -v -F -w "$2" ; echo "$1 $2" ) | sudo crontab -
-elif [[ "$3" == remove ]] ;then
- # remove cronjob:
- ( sudo crontab -l | grep -v -F -w "$2" ) | sudo crontab -
-fi
-}
-cronjob_editor "$1" "$2" "$3"
-EOF
-sudo chmod +x /usr/local/bin/cronedit.sh
-#
-sudo cat > /opt/conf.txt <<- "EOF"
-
-[D-APRS]
-MODE: MASTER
-ENABLED: True
-REPEAT: False
-MAX_PEERS: 1
-EXPORT_AMBE: False
-IP:
-PORT: 52555
-PASSPHRASE:
-GROUP_HANGTIME: 0
-USE_ACL: True
-REG_ACL: DENY:1
-SUB_ACL: DENY:1
-TGID_TS1_ACL: PERMIT:ALL
-TGID_TS2_ACL: PERMIT:ALL
-DEFAULT_UA_TIMER: 10
-SINGLE_MODE: False
-VOICE_IDENT: False
-TS1_STATIC:
-TS2_STATIC:
-DEFAULT_REFLECTOR: 0
-ANNOUNCEMENT_LANGUAGE: es_ES
-GENERATOR: 2
-ALLOW_UNREG_ID: True
-PROXY_CONTROL: False
-OVERRIDE_IDENT_TG:
-
-[EchoTest]
-MODE: PEER
-ENABLED: True
-LOOSE: True
-EXPORT_AMBE: False
-IP:
-#127.0.0.1
-PORT: 49060
-MASTER_IP: 127.0.0.1
-MASTER_PORT: 49061
-PASSPHRASE: passw0rd
-CALLSIGN: ECHOTEST
-RADIO_ID: 9990
-RX_FREQ: 449000000
-TX_FREQ: 444000000
-TX_POWER: 25
-COLORCODE: 1
-SLOTS: 3
-LATITUDE: 38.0000
-LONGITUDE: -095.0000
-HEIGHT: 75
-LOCATION: Local Parrot
-DESCRIPTION: This is a cool repeater
-URL: www.w1abc.org
-SOFTWARE_ID: 20170620
-PACKAGE_ID: MMDVM_HBlink
-GROUP_HANGTIME: 3
-OPTIONS:
-#TS2=9990;DIAL=0;VOICE=0;TIMER=0
-USE_ACL: True
-SUB_ACL: DENY:1
-TGID_TS1_ACL: DENY:ALL
-TGID_TS2_ACL: PERMIT:9990
-TS1_STATIC:
-TS2_STATIC:9990
-DEFAULT_REFLECTOR: 0
-ANNOUNCEMENT_LANGUAGE: en_GB
-GENERATOR: 0
-DEFAULT_UA_TIMER: 999
-SINGLE_MODE: True
-VOICE_IDENT: False
-
-EOF
-##
-sudo sed -i 's/ALLOW_NULL_PASSPHRASE: True/ALLOW_NULL_PASSPHRASE: False/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
-sudo sed -i 's/PASSPHRASE:/PASSPHRASE: passw0rd/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
-sudo sed -i 's/ALLOW_NULL_PASSPHRASE: passw0rd False/ALLOW_NULL_PASSPHRASE: False/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
-
-cp /opt/FreeDMR/FreeDMR-SAMPLE.cfg /opt/FreeDMR-SAMPLE.cfg
-cd /opt/
-cat FreeDMR-SAMPLE.cfg conf.txt obp.txt >> /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/file-timed/console-timed/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/INFO/DEBUG/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/freedmr.log/\/var\/log\/FreeDMR\/FreeDMR.log/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/ANNOUNCEMENT_LANGUAGE: en_GB/ANNOUNCEMENT_LANGUAGE: es_ES/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/VOICE_IDENT: True/VOICE_IDENT: False/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i "s/SERVER_ID: 0000/SERVER_ID: $variable/g" /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i "s/TGID_URL:/#TGID_URL:/g" /opt/FreeDMR/config/FreeDMR.cfg
-sed '37 a TGID_URL: https://freedmr.cymru/talkgroups/talkgroup_ids_json.php' -i /opt/FreeDMR/config/FreeDMR.cfg
-rm /opt/conf.txt
-cd /opt/FreeDMR/
-mv loro.cfg /opt/FreeDMR/playback.cfg
-sudo sed -i 's/54915/49061/' /opt/FreeDMR/playback.cfg
-######
-cat /opt/rules.txt >> /opt/FreeDMR/config/rules.py
-sudo rm /opt/FreeDMR/hotspot_proxy_v2.py
-cp /opt/FDMR-Monitor/proxy/* /opt/FreeDMR/ -r
-#####################
-sudo cat > /lib/systemd/system/freedmr.service <<- "EOF"
-[Unit]
-Description=FreeDmr
-After=multi-user.target
-
-[Service]
-User=root
-Type=simple
-Restart=always
-RestartSec=3
-StandardOutput=null
-ExecStartPre=/bin/sh -c 'until ping -c1 noip.com; do sleep 1; done;'
-ExecStart=/usr/bin/python3 /opt/FreeDMR/bridge_master.py -c /opt/FreeDMR/config/FreeDMR.cfg -r /opt/FreeDMR/config/rules.py
-
-[Install]
-WantedBy=multi-user.target
-
-EOF
-###
-#
-sudo cat > /lib/systemd/system/proxy.service <<- "EOF"
-[Unit]
-Description= Proxy Service
-
-After=multi-user.target
-
-
-[Service]
-User=root
-Type=simple
-Restart=always
-RestartSec=3
-StandardOutput=null
-ExecStartPre=/bin/sh -c 'until ping -c1 noip.com; do sleep 1; done;'
-#WorkingDirectory=/opt/FreeDMR
-#ExecStart=/usr/bin/python3 /opt/FreeDMR/hotspot_proxy_v2.py
-ExecStart=/usr/bin/python3 /opt/FreeDMR/hotspot_proxy_v2.py -c /opt/FreeDMR/proxy.cfg
-
-[Install]
-WantedBy=multi-user.target
-
-EOF
-##
-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
-###
-sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/menu.sh)"
-
-cronedit.sh '* */6 * * *' 'data-id' remove
-sudo chmod +x /opt/FreeDMR/*.py
-sudo chmod +x /opt/FreeDMR/config/*.py
-sudo chmod +x /opt/extra-1.sh
-sudo sh /opt/extra-1.sh
-sudo systemctl daemon-reload
-sudo systemctl start proxy.service
-sudo systemctl start freedmr.service
-sudo systemctl start fdmrparrot.service
-sudo systemctl restart fdmr_mon.service
-# ExecStart=/usr/bin/python3 /opt/FreeDMR/bridge_master.py -c /opt/FreeDMR/config/FreeDMR.cfg -r /opt/FreeDMR/config/rules.py
-
-# ExecStart=/usr/bin/python3 /opt/FreeDMR/playback.py -c /opt/FreeDMR/playback.cfg
-
-#
-
-cd /
+cd /
+variable=$(grep "SERVER_ID:" /opt/FreeDMR/config/FreeDMR.cfg | tail -c 5)
+sudo systemctl stop freedmr.service
+sudo systemctl stop proxy.service
+sudo systemctl stop fdmrparrot.service
+rm -r /opt/FreeDMR
+cd /opt
+git clone https://gitlab.hacknix.net/hacknix/FreeDMR.git
+#git clone https://github.com/hp3icc/FreeDMR.git
+cd FreeDMR
+mkdir config
+mkdir /var/log/FreeDMR
+chmod +x /opt/FreeDMR/install.sh
+./install.sh
+sudo cat > /opt/conf.txt <<- "EOF"
+
+[D-APRS]
+MODE: MASTER
+ENABLED: True
+REPEAT: False
+MAX_PEERS: 1
+EXPORT_AMBE: False
+IP:
+PORT: 52555
+PASSPHRASE:
+GROUP_HANGTIME: 0
+USE_ACL: True
+REG_ACL: DENY:1
+SUB_ACL: DENY:1
+TGID_TS1_ACL: PERMIT:ALL
+TGID_TS2_ACL: PERMIT:ALL
+DEFAULT_UA_TIMER: 10
+SINGLE_MODE: False
+VOICE_IDENT: False
+TS1_STATIC:
+TS2_STATIC:
+DEFAULT_REFLECTOR: 0
+ANNOUNCEMENT_LANGUAGE: es_ES
+GENERATOR: 2
+ALLOW_UNREG_ID: True
+PROXY_CONTROL: False
+OVERRIDE_IDENT_TG:
+
+[EchoTest]
+MODE: PEER
+ENABLED: True
+LOOSE: True
+EXPORT_AMBE: False
+IP:
+#127.0.0.1
+PORT: 49060
+MASTER_IP: 127.0.0.1
+MASTER_PORT: 49061
+PASSPHRASE: passw0rd
+CALLSIGN: ECHOTEST
+RADIO_ID: 9990
+RX_FREQ: 449000000
+TX_FREQ: 444000000
+TX_POWER: 25
+COLORCODE: 1
+SLOTS: 3
+LATITUDE: 38.0000
+LONGITUDE: -095.0000
+HEIGHT: 75
+LOCATION: Local Parrot
+DESCRIPTION: This is a cool repeater
+URL: www.w1abc.org
+SOFTWARE_ID: 20170620
+PACKAGE_ID: MMDVM_HBlink
+GROUP_HANGTIME: 3
+OPTIONS:
+#TS2=9990;DIAL=0;VOICE=0;TIMER=0
+USE_ACL: True
+SUB_ACL: DENY:1
+TGID_TS1_ACL: DENY:ALL
+TGID_TS2_ACL: PERMIT:9990
+TS1_STATIC:
+TS2_STATIC:9990
+DEFAULT_REFLECTOR: 0
+ANNOUNCEMENT_LANGUAGE: en_GB
+GENERATOR: 0
+DEFAULT_UA_TIMER: 999
+SINGLE_MODE: True
+VOICE_IDENT: False
+
+EOF
+##
+sudo sed -i 's/ALLOW_NULL_PASSPHRASE: True/ALLOW_NULL_PASSPHRASE: False/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
+sudo sed -i 's/PASSPHRASE:/PASSPHRASE: passw0rd/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
+sudo sed -i 's/ALLOW_NULL_PASSPHRASE: passw0rd False/ALLOW_NULL_PASSPHRASE: False/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
+
+cp /opt/FreeDMR/FreeDMR-SAMPLE.cfg /opt/
+cd /opt/
+cat FreeDMR-SAMPLE.cfg conf.txt obp.txt >> /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/file-timed/console-timed/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/INFO/DEBUG/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/freedmr.log/\/var\/log\/FreeDMR\/FreeDMR.log/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/ANNOUNCEMENT_LANGUAGE: en_GB/ANNOUNCEMENT_LANGUAGE: es_ES/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/VOICE_IDENT: True/VOICE_IDENT: False/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i "s/SERVER_ID: 0000/SERVER_ID: $variable/g" /opt/FreeDMR/config/FreeDMR.cfg
+#sudo sed -i 's/REPORT_CLIENTS: 127.0.0.1/REPORT_CLIENTS: */' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i "s/TGID_URL:/#TGID_URL:/g" /opt/FreeDMR/config/FreeDMR.cfg
+sed '37 a TGID_URL: https://freedmr.cymru/talkgroups/talkgroup_ids_json.php' -i /opt/FreeDMR/config/FreeDMR.cfg
+#sed '43 a TOPO_FILE: topography.json' -i /opt/FreeDMR/config/FreeDMR.cfg
+rm /opt/conf.txt
+#rm /opt/obp.txt
+cd /opt/FreeDMR/
+mv loro.cfg /opt/FreeDMR/playback.cfg
+sudo sed -i 's/54915/49061/' /opt/FreeDMR/playback.cfg
+#sudo sed -i "121,129d" /opt/FreeDMR/playback.cfg
+######
+cat /opt/rules.txt >> /opt/FreeDMR/config/rules.py
+#sed '14 a VALIDATE_SERVER_IDS: True' -i /opt/FreeDMR/config/FreeDMR.cfg
+#sed '105 a override_ident_tg:' -i /opt/FreeDMR/config/FreeDMR.cfg
+sudo rm /opt/FreeDMR/hotspot_proxy_v2.py
+#sudo rm /opt/FreeDMR/proxy_db.*
+cp /opt/FDMR-Monitor/proxy/* /opt/FreeDMR/ -r
+#####################
+sudo cat > /lib/systemd/system/freedmr.service <<- "EOF"
+[Unit]
+Description=FreeDmr
+After=multi-user.target
+
+[Service]
+User=root
+Type=simple
+Restart=always
+RestartSec=3
+StandardOutput=null
+ExecStartPre=/bin/sh -c 'until ping -c1 noip.com; do sleep 1; done;'
+ExecStart=/usr/bin/python3 /opt/FreeDMR/bridge_master.py -c /opt/FreeDMR/config/FreeDMR.cfg -r /opt/FreeDMR/config/rules.py
+
+[Install]
+WantedBy=multi-user.target
+
+EOF
+###
+#
+sudo cat > /lib/systemd/system/proxy.service <<- "EOF"
+[Unit]
+Description= Proxy Service
+
+After=multi-user.target
+
+
+[Service]
+User=root
+Type=simple
+Restart=always
+RestartSec=3
+StandardOutput=null
+ExecStartPre=/bin/sh -c 'until ping -c1 noip.com; do sleep 1; done;'
+#WorkingDirectory=/opt/FreeDMR
+#ExecStart=/usr/bin/python3 /opt/FreeDMR/hotspot_proxy_v2.py
+ExecStart=/usr/bin/python3 /opt/FreeDMR/hotspot_proxy_v2.py -c /opt/FreeDMR/proxy.cfg
+
+[Install]
+WantedBy=multi-user.target
+
+EOF
+##
+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
+#sudo sed -i "56,63d" /opt/FreeDMR/config/FreeDMR.cfg
+###
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/menu.sh)"
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/emq-TE1ws/main/self/data-id-update.sh)"
+data-id
+sudo chmod +x /opt/FreeDMR/*.py
+sudo chmod +x /opt/FreeDMR/config/*.py
+rm /opt/FreeDMR-SAMPLE.cfg
+sudo chmod +x /opt/extra-1.sh
+sudo sh /opt/extra-1.sh
+sudo systemctl daemon-reload
+sudo systemctl start proxy.service
+sudo systemctl start freedmr.service
+sudo systemctl start fdmrparrot.service
+sudo systemctl restart fdmr_mon.service
+# ExecStart=/usr/bin/python3 /opt/FreeDMR/bridge_master.py -c /opt/FreeDMR/config/FreeDMR.cfg -r /opt/FreeDMR/config/rules.py
+
+# ExecStart=/usr/bin/python3 /opt/FreeDMR/playback.py -c /opt/FreeDMR/playback.cfg
+
+#
+
+cd /
diff --git a/install.sh b/install.sh
index 083ce47..521d540 100644
--- a/install.sh
+++ b/install.sh
@@ -1,659 +1,672 @@
-#!/bin/sh
-echo Actualizando sistema
-apt-get update
-# apt-get upgrade -y
-#########
-apt-get install sudo -y
-sudo apt-get purge needrestart -y
-sudo apt-get install wget -y
-sudo apt-get install git -y
-sudo apt-get install screen -y
-sudo apt-get install gcc -y
-sudo apt-get install g++ -y
-sudo apt-get install make -y
-sudo apt-get install cmake -y
-sudo apt-get install musl-dev -y
-sudo apt-get install python2 -y
-
-update-alternatives --install /usr/bin/python python /usr/bin/python3 1
-#
-sudo apt-get install rsyslog -y
-sudo apt-get install logrotate -y
-sudo apt-get install gpsd -y
-sudo apt-get install qt4-qmake -y
-sudo apt-get install libtool -y
-sudo apt-get install autoconf -y
-sudo apt-get install automake -y
-sudo apt-get install python-pkg-resources -y
-sudo apt-get install sox -y
-sudo apt-get install git-core -y
-
-sudo apt-get install chkconfig -y
-
-sudo apt-get install libffi-dev -y
-sudo apt-get install libssl-dev -y
-sudo apt-get install cargo -y
-sudo apt-get install sed -y
-sudo apt install python3-pip -y
-sudo apt install python3-distutils -y
-sudo apt install python3-dev -y
-sudo apt install python3-websockets
-sudo apt install python3-psutil
-
-sudo apt install socket
-sudo apt install threading
-sudo apt install queue
-sudo apt install sys
-sudo apt install os
-sudo apt install time
-sudo apt install re
-sudo apt install datetime
-sudo apt install signal
-sudo apt install datetime
-sudo apt install bisect
-sudo apt install struct
-sudo apt install ansi2html
-sudo apt install logrotate
-sudo pip3 install ansi2html
-sudo apt-get install python-pip -y
-sudo apt-get install python-dev -y
-sudo apt-get install rrdtool -y
-#
-cat > /usr/local/bin/cronedit.sh <<- "EOF"
-cronjob_editor () {
-# usage: cronjob_editor '' ''
-if [[ -z "$1" ]] ;then printf " no interval specified\n" ;fi
-if [[ -z "$2" ]] ;then printf " no command specified\n" ;fi
-if [[ -z "$3" ]] ;then printf " no action specified\n" ;fi
-if [[ "$3" == add ]] ;then
- # add cronjob, no duplication:
- ( sudo crontab -l | grep -v -F -w "$2" ; echo "$1 $2" ) | sudo crontab -
-elif [[ "$3" == remove ]] ;then
- # remove cronjob:
- ( sudo crontab -l | grep -v -F -w "$2" ) | sudo crontab -
-fi
-}
-cronjob_editor "$1" "$2" "$3"
-EOF
-sudo chmod +x /usr/local/bin/cronedit.sh
-#
-if [ -d "/opt/FreeDMR" ];
-then
- sudo rm /opt/FreeDMR/ -r
- #echo "found file"
-else
- echo "file not found"
-
-fi
-if [ -d "/opt/FDMR-Monitor" ];
-then
- sudo rm /opt/FDMR-Monitor/ -r
- #echo "found file"
-else
- echo "file not found"
-
-fi
-if [ -d "/var/www" ];
-then
- echo "found file"
-else
- mkdir /var/www
- #echo "file not found"
-
-fi
-if [ -d "/var/www/fdmr" ];
-then
- sudo rm /var/www/fdmr/ -r
- #echo "found file"
-else
- echo "file not found"
-
-fi
-##################
-sudo cat > /opt/emq-ver <<- "EOF"
-EMQ-VER: 20
-EOF
-#########
-cd /home/
-wget https://bootstrap.pypa.io/get-pip.py
-sudo python3 get-pip.py
-sudo cat > /home/requirements.txt <<- "EOF"
-autobahn
-jinja2==2.11.3
-bitstring>=3.1.5
-bitarray>=0.8.1
-Twisted>=16.3.0
-dmr_utils3>=0.1.19
-configparser>=3.0.0
-aprslib>=0.6.42
-tinydb
-pynmea2
-maidenhead
-requests
-libscrc
-flask
-folium
-mysql-connector
-resettabletimer>=0.7.0
-setproctitle
-
-EOF
-#
-pip3 install setuptools wheel
-pip3 install -r requirements.txt
-sudo rm requirements.txt
-sudo rm get-pip.py
-#
-mkdir /var/www/fdmr
-
-mkdir /var/log/FreeDMR
-sudo chmod +777 /var/log
-sudo chmod +777 /var/log/*
-
-#
-sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/menu.sh)"
-
-########################
-if [ -f "/opt/obp.txt" ]
-then
- echo "found file"
-else
- sudo cat > /opt/obp.txt <<- "EOF"
-
-#Coloque abajo su lista de obp y peer
-
-EOF
-fi
-######################
-if [ -f "/opt/rules.txt" ]
-then
- echo "found file"
-else
- 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 [ -f "/opt/extra-1.sh" ]
-then
- echo "found file"
-else
- 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
-cp /opt/extra-1.sh /opt/extra-3.sh
-cp /opt/extra-1.sh /opt/extra-4.sh
-cp /opt/extra-1.sh /opt/extra-5.sh
-cp /opt/extra-1.sh /opt/extra-6.sh
-fi
-sudo chmod +x /opt/extra-*
-
-###################
-cd /opt
-git clone https://gitlab.hacknix.net/hacknix/FreeDMR.git
-cd FreeDMR
-mkdir config
-sudo chmod +x /opt/FreeDMR/*.py
-sudo cat > /opt/conf.txt <<- "EOF"
-
-
-[D-APRS]
-MODE: MASTER
-ENABLED: True
-REPEAT: False
-MAX_PEERS: 1
-EXPORT_AMBE: False
-IP:
-PORT: 52555
-PASSPHRASE:
-GROUP_HANGTIME: 0
-USE_ACL: True
-REG_ACL: DENY:1
-SUB_ACL: DENY:1
-TGID_TS1_ACL: PERMIT:ALL
-TGID_TS2_ACL: PERMIT:ALL
-DEFAULT_UA_TIMER: 10
-SINGLE_MODE: False
-VOICE_IDENT: False
-TS1_STATIC:
-TS2_STATIC:
-DEFAULT_REFLECTOR: 0
-ANNOUNCEMENT_LANGUAGE: es_ES
-GENERATOR: 2
-ALLOW_UNREG_ID: True
-PROXY_CONTROL: False
-OVERRIDE_IDENT_TG:
-
-[EchoTest]
-MODE: PEER
-ENABLED: True
-LOOSE: True
-EXPORT_AMBE: False
-IP:
-#127.0.0.1
-PORT: 49060
-MASTER_IP: 127.0.0.1
-MASTER_PORT: 49061
-PASSPHRASE: passw0rd
-CALLSIGN: ECHOTEST
-RADIO_ID: 9990
-RX_FREQ: 449000000
-TX_FREQ: 444000000
-TX_POWER: 25
-COLORCODE: 1
-SLOTS: 3
-LATITUDE: 38.0000
-LONGITUDE: -095.0000
-HEIGHT: 75
-LOCATION: Local Parrot
-DESCRIPTION: This is a cool repeater
-URL: www.w1abc.org
-SOFTWARE_ID: 20170620
-PACKAGE_ID: MMDVM_HBlink
-GROUP_HANGTIME: 3
-OPTIONS:
-#TS2=9990;DIAL=0;VOICE=0;TIMER=0
-USE_ACL: True
-SUB_ACL: DENY:1
-TGID_TS1_ACL: DENY:ALL
-TGID_TS2_ACL: PERMIT:9990
-TS1_STATIC:
-TS2_STATIC:9990
-DEFAULT_REFLECTOR: 0
-ANNOUNCEMENT_LANGUAGE: en_GB
-GENERATOR: 0
-DEFAULT_UA_TIMER: 999
-SINGLE_MODE: True
-VOICE_IDENT: False
-
-EOF
-##
-sudo sed -i 's/ALLOW_NULL_PASSPHRASE: True/ALLOW_NULL_PASSPHRASE: False/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
-sudo sed -i 's/PASSPHRASE:/PASSPHRASE: passw0rd/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
-sudo sed -i 's/ALLOW_NULL_PASSPHRASE: passw0rd False/ALLOW_NULL_PASSPHRASE: False/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
-
-cp /opt/FreeDMR/FreeDMR-SAMPLE.cfg /opt/FreeDMR-SAMPLE.cfg
-cd /opt/
-cat FreeDMR-SAMPLE.cfg conf.txt obp.txt >> /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/file-timed/console-timed/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/INFO/DEBUG/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/freedmr.log/\/var\/log\/FreeDMR\/FreeDMR.log/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/ANNOUNCEMENT_LANGUAGE: en_GB/ANNOUNCEMENT_LANGUAGE: es_ES/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i 's/VOICE_IDENT: True/VOICE_IDENT: False/' /opt/FreeDMR/config/FreeDMR.cfg
-sudo sed -i "s/TGID_URL:/#TGID_URL:/g" /opt/FreeDMR/config/FreeDMR.cfg
-sed '37 a TGID_URL: https://freedmr.cymru/talkgroups/talkgroup_ids_json.php' -i /opt/FreeDMR/config/FreeDMR.cfg
-#sed '43 a TOPO_FILE: topography.json' -i /opt/FreeDMR/config/FreeDMR.cfg
-#rm /opt/FreeDMR-SAMPLE.cfg
-rm /opt/conf.txt
-cd /opt/FreeDMR/
-mv loro.cfg /opt/FreeDMR/playback.cfg
-sudo sed -i 's/54915/49061/' /opt/FreeDMR/playback.cfg
-#sudo sed -i "121,129d" /opt/FreeDMR/playback.cfg
-########lamp
-sudo apt install mariadb-server php libapache2-mod-php php-zip php-mbstring php-cli php-common php-curl php-xml php-mysql -y
-
-systemctl restart mariadb
-systemctl enable mariadb
-#sudo mysql_secure_installation --host=localhost --port=3306
-echo "DROP USER emqte1@localhost" | /usr/bin/mysql -u root
-echo "DROP DATABASE selfcare" | /usr/bin/mysql -u root
-
-newUser='emqte1'
-newDbPassword=''
-newDb='selfcare'
-host=localhost
-#host='%'
-
-# MySQL 5.7 and earlier versions
-#commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';FLUSH PRIVILEGES;"
-
-# MySQL 8 and higher versions
-commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}';GRANT ALL ON \`${newDb}\`.* TO '${newUser}'@'${host}';FLUSH PRIVILEGES;"
-
-#cho "${commands}" | /usr/bin/mysql -u root -p
-echo "${commands}" | /usr/bin/mysql -u root
-###########################################
-#fdmr-monitor
-cd /opt
-sudo git clone https://github.com/yuvelq/FDMR-Monitor.git
-cd FDMR-Monitor
-sudo git checkout Self_Service
-sudo sed -i 's/RELOAD_TIME = 15/RELOAD_TIME = 1/' /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg
-sudo sed -i 's/FREQUENCY = 10/FREQUENCY = 120/' /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
-#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 cat > /opt/FDMR-Monitor/html/buttons.php <<- "EOF"
-
-Home
-
-
-
-
-
- SelfService';}?>
-
Login
- Devices';
- }
- ?>
-
-
-
-
-
-
-
-EOF
-
-#
-
-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
-sed '64 a #TGID_URL = https://freedmr.cymru/talkgroups/talkgroup_ids_flags_json.php' -i /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg
-cd /opt/FDMR-Monitor/
-sudo rm /opt/FDMR-Monitor/install.sh
-wget https://raw.githubusercontent.com/hp3icc/emq-TE1ws/main/self/install.sh
-sudo chmod +x /opt/FDMR-Monitor/install.sh
-sudo chmod +x /opt/FDMR-Monitor/*.py
-#
-sh /opt/FDMR-Monitor/install.sh
-sudo sh /opt/extra-2.sh
-#####################
-sudo sed -i "s/All rights reserved.
.*/All rights reserved.
\"2018\") {\$cdate=\"2018-\".date(\"Y\");} echo \$cdate; ?>\" target=\"_blank\" href=https:\/\/github.com\/hp3icc\/Easy-FreeDMR-SERVER-Install\/>Proyect: Easy-FreeDMR-SERVER-Install<\/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
-#sudo sed -i "56,63d" /opt/FreeDMR/config/FreeDMR.cfg
-#################
-
-#sed '33 a ' -i /var/www/html/sysinfo.php
-
-cp -r /opt/FDMR-Monitor/sysinfo/ /var/www/fdmr/sysinfo/
-
-#########
-sudo cat > /opt/FreeDMR/config/rules.py <<- "EOF"
-'''
-THIS EXAMPLE WILL NOT WORK AS IT IS - YOU MUST SPECIFY YOUR OWN VALUES!!!
-
-In FreeDMR, the rules file should be *empty* unless you have static routing required. Please see the
-documentation for more details.
-
-This file is organized around the "Conference Bridges" that you wish to use. If you're a c-Bridge
-person, think of these as "bridge groups". You might also liken them to a "reflector". If a particular
-system is "ACTIVE" on a particular conference bridge, any traffid from that system will be sent
-to any other system that is active on the bridge as well. This is not an "end to end" method, because
-each system must independently be activated on the bridge.
-
-The first level (e.g. "WORLDWIDE" or "STATEWIDE" in the examples) is the name of the conference
-bridge. This is any arbitrary ASCII text string you want to use. Under each conference bridge
-definition are the following items -- one line for each HBSystem as defined in the main HBlink
-configuration file.
-
- * SYSTEM - The name of the sytem as listed in the main hblink configuration file (e.g. hblink.cfg)
- This MUST be the exact same name as in the main config file!!!
- * TS - Timeslot used for matching traffic to this confernce bridge
- XLX connections should *ALWAYS* use TS 2 only.
- * TGID - Talkgroup ID used for matching traffic to this conference bridge
- XLX connections should *ALWAYS* use TG 9 only.
- * ON and OFF are LISTS of Talkgroup IDs used to trigger this system off and on. Even if you
- only want one (as shown in the ON example), it has to be in list format. None can be
- handled with an empty list, such as " 'ON': [] ".
- * TO_TYPE is timeout type. If you want to use timers, ON means when it's turned on, it will
- turn off afer the timout period and OFF means it will turn back on after the timout
- period. If you don't want to use timers, set it to anything else, but 'NONE' might be
- a good value for documentation!
- * TIMOUT is a value in minutes for the timout timer. No, I won't make it 'seconds', so don't
- ask. Timers are performance "expense".
- * RESET is a list of Talkgroup IDs that, in addition to the ON and OFF lists will cause a running
- timer to be reset. This is useful if you are using different TGIDs for voice traffic than
- triggering. If you are not, there is NO NEED to use this feature.
-'''
-
-BRIDGES = {
-
- '9990': [
- {'SYSTEM': 'EchoTest', 'TS': 2, 'TGID': 9990, 'ACTIVE':True, 'TIMEOUT': 0, 'TO_TYPE': 'NONE', 'ON': [], 'OFF': [], 'RESET': []},
-
- ],
-
-
-}
-if __name__ == '__main__':
- from pprint import pprint
- pprint(BRIDGES)
-
-EOF
-##########################
-
-sudo cat > /lib/systemd/system/proxy.service <<- "EOF"
-[Unit]
-Description= Proxy Service
-
-After=multi-user.target
-
-
-[Service]
-User=root
-Type=simple
-Restart=always
-RestartSec=3
-StandardOutput=null
-ExecStartPre=/bin/sh -c 'until ping -c1 noip.com; do sleep 1; done;'
-#WorkingDirectory=/opt/FreeDMR
-#ExecStart=/usr/bin/python3 /opt/FreeDMR/hotspot_proxy_v2.py
-ExecStart=/usr/bin/python3 /opt/FreeDMR/hotspot_proxy_v2.py -c /opt/FreeDMR/proxy.cfg
-
-[Install]
-WantedBy=multi-user.target
-
-EOF
-#########
-sudo cat > /lib/systemd/system/freedmr.service <<- "EOF"
-[Unit]
-Description=FreeDmr
-After=multi-user.target
-
-[Service]
-User=root
-Type=simple
-Restart=always
-RestartSec=3
-StandardOutput=null
-ExecStartPre=/bin/sh -c 'until ping -c1 noip.com; do sleep 1; done;'
-ExecStart=/usr/bin/python3 /opt/FreeDMR/bridge_master.py -c /opt/FreeDMR/config/FreeDMR.cfg -r /opt/FreeDMR/config/rules.py
-
-[Install]
-WantedBy=multi-user.target
-
-EOF
-###
-sudo cat > /lib/systemd/system/fdmrparrot.service <<- "EOF"
-[Unit]
-
-Description=Freedmr Parrot
-
-After=network-online.target syslog.target
-
-Wants=network-online.target
-
-[Service]
-
-StandardOutput=null
-
-WorkingDirectory=/opt/FreeDMR
-
-RestartSec=3
-
-ExecStart=/usr/bin/python3 /opt/FreeDMR/playback.py -c /opt/FreeDMR/playback.cfg
-#/usr/bin/python3 /opt/HBlink3/playback.py -c /opt/HBlink3/playback.cfg
-
-Restart=on-abort
-
-[Install]
-
-WantedBy=multi-user.target
-
-EOF
-##############################
-
-sudo systemctl stop rsyslog
-sudo systemctl disable rsyslog
-sudo systemctl disable systemd-networkd-wait-online.service
-sudo systemctl disable dphys-swapfile-back.service
-mv /lib/systemd/system/dphys-swapfile.service /lib/systemd/system/dphys-swapfile-back.service
-rm /var/log/syslog*
-rm /var/log/*.log*
-
-(crontab -l; echo "* */1 * * * sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1")|awk '!x[$0]++'|crontab -
-#sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/emq-TE1ws/main/self/data-id-update.sh)"
-#data-id
-#####
-sudo update-rc.d dphys-swapfile remove
-sudo chmod -x /etc/init.d/dphys-swapfile
-sudo dphys-swapfile swapoff
-sudo swapoff -a
-sudo rm /var/swap
-sudo dphys-swapfile uninstall
-cd /etc/
-sudo sed -i 's/CONF_SWAPSIZE=100/CONF_SWAPSIZE=0/' dphys-swapfile
-cd /
-##################
-sudo systemctl daemon-reload
-systemctl start freedmr.service
-systemctl enable freedmr.service
-systemctl start proxy.service
-systemctl enable proxy.service
-systemctl start fdmrparrot.service
-systemctl enable fdmrparrot.service
-#################
-if [ -f "/opt/FDMR-Monitor/sysinfo/tempC.rrd" ]
-then
- rm /opt/FDMR-Monitor/sysinfo/*.rrd
-elif
- [ -f "/opt/FDMR-Monitor/sysinfo/load.rrd" ]
-then
- rm /opt/FDMR-Monitor/sysinfo/*.rrd
-elif
- [ -f "/opt/FDMR-Monitor/sysinfo/hdd.rrd" ]
-then
- rm /opt/FDMR-Monitor/sysinfo/*.rrd
-fi
-
-sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh
-######################
-(crontab -l; echo "*/5 * * * * sh /opt/FDMR-Monitor/sysinfo/graph.sh")|awk '!x[$0]++'|crontab -
-(crontab -l; echo "*/2 * * * * sh /opt/FDMR-Monitor/sysinfo/cpu.sh")|awk '!x[$0]++'|crontab -
-#(crontab -l; echo "* */6 * * * data-id")|awk '!x[$0]++'|crontab -
-cronedit.sh '* */6 * * *' 'data-id' remove
-sudo systemctl enable fdmr_mon.service
-#sudo systemctl restart apache2.service
-#sudo systemctl enable apache2.service
-sudo systemctl start fdmr_mon.service
-sudo systemctl restart http.server-fdmr.service
-sudo systemctl enable http.server-fdmr.service
-chmod +x /bin/menu*
-chmod +x /bin/MENU
-history -c && history -w
-menu
-#####
-
+#!/bin/sh
+echo Actualizando sistema
+apt-get update
+# apt-get upgrade -y
+#########
+apt-get install sudo -y
+sudo apt-get purge needrestart -y
+sudo apt-get install wget -y
+sudo apt-get install git -y
+sudo apt-get install screen -y
+sudo apt-get install gcc -y
+sudo apt-get install g++ -y
+sudo apt-get install make -y
+sudo apt-get install cmake -y
+sudo apt-get install musl-dev -y
+sudo apt-get install python2 -y
+
+update-alternatives --install /usr/bin/python python /usr/bin/python3 1
+#
+sudo apt-get install rsyslog -y
+sudo apt-get install logrotate -y
+sudo apt-get install gpsd -y
+sudo apt-get install qt4-qmake -y
+sudo apt-get install libtool -y
+sudo apt-get install autoconf -y
+sudo apt-get install automake -y
+sudo apt-get install python-pkg-resources -y
+sudo apt-get install sox -y
+sudo apt-get install git-core -y
+
+sudo apt-get install chkconfig -y
+
+sudo apt-get install libffi-dev -y
+sudo apt-get install libssl-dev -y
+sudo apt-get install cargo -y
+sudo apt-get install sed -y
+sudo apt install python3-pip -y
+sudo apt install python3-distutils -y
+sudo apt install python3-dev -y
+sudo apt install python3-websockets
+sudo apt install python3-psutil
+
+sudo apt install socket
+sudo apt install threading
+sudo apt install queue
+sudo apt install sys
+sudo apt install os
+sudo apt install time
+sudo apt install re
+sudo apt install datetime
+sudo apt install signal
+sudo apt install datetime
+sudo apt install bisect
+sudo apt install struct
+sudo apt install ansi2html
+sudo apt install logrotate
+sudo pip3 install ansi2html
+sudo apt-get install python-pip -y
+sudo apt-get install python-dev -y
+sudo apt-get install rrdtool -y
+#
+if [ -d "/opt/FreeDMR" ];
+then
+ sudo rm /opt/FreeDMR/ -r
+ #echo "found file"
+else
+ echo "file not found"
+
+fi
+if [ -d "/opt/FDMR-Monitor" ];
+then
+ sudo rm /opt/FDMR-Monitor/ -r
+ #echo "found file"
+else
+ echo "file not found"
+
+fi
+if [ -d "/var/www" ];
+then
+ echo "found file"
+else
+ mkdir /var/www
+ #echo "file not found"
+
+fi
+if [ -d "/var/www/fdmr" ];
+then
+ sudo rm /var/www/fdmr/ -r
+ #echo "found file"
+else
+ echo "file not found"
+
+fi
+##################
+sudo cat > /opt/emq-ver <<- "EOF"
+EMQ-VER: 20
+EOF
+#########
+cd /home/
+wget https://bootstrap.pypa.io/get-pip.py
+sudo python3 get-pip.py
+sudo cat > /home/requirements.txt <<- "EOF"
+autobahn
+jinja2==2.11.3
+bitstring>=3.1.5
+bitarray>=0.8.1
+Twisted>=16.3.0
+dmr_utils3>=0.1.19
+configparser>=3.0.0
+aprslib>=0.6.42
+tinydb
+pynmea2
+maidenhead
+requests
+libscrc
+flask
+folium
+mysql-connector
+resettabletimer>=0.7.0
+setproctitle
+
+EOF
+#
+pip3 install setuptools wheel
+pip3 install -r requirements.txt
+sudo rm requirements.txt
+sudo rm get-pip.py
+#
+mkdir /var/www/fdmr
+
+mkdir /var/log/FreeDMR
+sudo chmod +777 /var/log
+sudo chmod +777 /var/log/*
+
+#
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/menu.sh)"
+
+########################
+if [ -f "/opt/obp.txt" ]
+then
+ echo "found file"
+else
+ sudo cat > /opt/obp.txt <<- "EOF"
+
+#Coloque abajo su lista de obp y peer
+
+EOF
+fi
+######################
+if [ -f "/opt/rules.txt" ]
+then
+ echo "found file"
+else
+ 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 [ -f "/opt/extra-1.sh" ]
+then
+ echo "found file"
+else
+ 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
+cp /opt/extra-1.sh /opt/extra-3.sh
+cp /opt/extra-1.sh /opt/extra-4.sh
+cp /opt/extra-1.sh /opt/extra-5.sh
+cp /opt/extra-1.sh /opt/extra-6.sh
+fi
+sudo chmod +x /opt/extra-*
+
+###################
+cat > /usr/local/bin/cronedit.sh <<- "EOF"
+cronjob_editor () {
+# usage: cronjob_editor '' ''
+
+if [[ -z "$1" ]] ;then printf " no interval specified\n" ;fi
+if [[ -z "$2" ]] ;then printf " no command specified\n" ;fi
+if [[ -z "$3" ]] ;then printf " no action specified\n" ;fi
+
+if [[ "$3" == add ]] ;then
+ # add cronjob, no duplication:
+ ( sudo crontab -l | grep -v -F -w "$2" ; echo "$1 $2" ) | sudo crontab -
+elif [[ "$3" == remove ]] ;then
+ # remove cronjob:
+ ( sudo crontab -l | grep -v -F -w "$2" ) | sudo crontab -
+fi
+}
+cronjob_editor "$1" "$2" "$3"
+
+
+EOF
+sudo chmod +x /usr/local/bin/cronedit.sh
+
+##############
+cd /opt
+git clone https://gitlab.hacknix.net/hacknix/FreeDMR.git
+cd FreeDMR
+mkdir config
+sudo chmod +x /opt/FreeDMR/*.py
+sudo cat > /opt/conf.txt <<- "EOF"
+
+
+[D-APRS]
+MODE: MASTER
+ENABLED: True
+REPEAT: False
+MAX_PEERS: 1
+EXPORT_AMBE: False
+IP:
+PORT: 52555
+PASSPHRASE:
+GROUP_HANGTIME: 0
+USE_ACL: True
+REG_ACL: DENY:1
+SUB_ACL: DENY:1
+TGID_TS1_ACL: PERMIT:ALL
+TGID_TS2_ACL: PERMIT:ALL
+DEFAULT_UA_TIMER: 10
+SINGLE_MODE: False
+VOICE_IDENT: False
+TS1_STATIC:
+TS2_STATIC:
+DEFAULT_REFLECTOR: 0
+ANNOUNCEMENT_LANGUAGE: es_ES
+GENERATOR: 2
+ALLOW_UNREG_ID: True
+PROXY_CONTROL: False
+OVERRIDE_IDENT_TG:
+
+[EchoTest]
+MODE: PEER
+ENABLED: True
+LOOSE: True
+EXPORT_AMBE: False
+IP:
+#127.0.0.1
+PORT: 49060
+MASTER_IP: 127.0.0.1
+MASTER_PORT: 49061
+PASSPHRASE: passw0rd
+CALLSIGN: ECHOTEST
+RADIO_ID: 9990
+RX_FREQ: 449000000
+TX_FREQ: 444000000
+TX_POWER: 25
+COLORCODE: 1
+SLOTS: 3
+LATITUDE: 38.0000
+LONGITUDE: -095.0000
+HEIGHT: 75
+LOCATION: Local Parrot
+DESCRIPTION: This is a cool repeater
+URL: www.w1abc.org
+SOFTWARE_ID: 20170620
+PACKAGE_ID: MMDVM_HBlink
+GROUP_HANGTIME: 3
+OPTIONS:
+#TS2=9990;DIAL=0;VOICE=0;TIMER=0
+USE_ACL: True
+SUB_ACL: DENY:1
+TGID_TS1_ACL: DENY:ALL
+TGID_TS2_ACL: PERMIT:9990
+TS1_STATIC:
+TS2_STATIC:9990
+DEFAULT_REFLECTOR: 0
+ANNOUNCEMENT_LANGUAGE: en_GB
+GENERATOR: 0
+DEFAULT_UA_TIMER: 999
+SINGLE_MODE: True
+VOICE_IDENT: False
+
+EOF
+##
+sudo sed -i 's/ALLOW_NULL_PASSPHRASE: True/ALLOW_NULL_PASSPHRASE: False/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
+sudo sed -i 's/PASSPHRASE:/PASSPHRASE: passw0rd/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
+sudo sed -i 's/ALLOW_NULL_PASSPHRASE: passw0rd False/ALLOW_NULL_PASSPHRASE: False/' /opt/FreeDMR/FreeDMR-SAMPLE.cfg
+
+cp /opt/FreeDMR/FreeDMR-SAMPLE.cfg /opt/
+cd /opt/
+cat FreeDMR-SAMPLE.cfg conf.txt obp.txt >> /opt/FreeDMR/config/FreeDMR.cfg
+#sudo sed -i 's/REPORT_CLIENTS: 127.0.0.1/REPORT_CLIENTS: */' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/file-timed/console-timed/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/INFO/DEBUG/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/freedmr.log/\/var\/log\/FreeDMR\/FreeDMR.log/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/ANNOUNCEMENT_LANGUAGE: en_GB/ANNOUNCEMENT_LANGUAGE: es_ES/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i 's/VOICE_IDENT: True/VOICE_IDENT: False/' /opt/FreeDMR/config/FreeDMR.cfg
+sudo sed -i "s/TGID_URL:/#TGID_URL:/g" /opt/FreeDMR/config/FreeDMR.cfg
+sed '37 a TGID_URL: https://freedmr.cymru/talkgroups/talkgroup_ids_json.php' -i /opt/FreeDMR/config/FreeDMR.cfg
+#sed '43 a TOPO_FILE: topography.json' -i /opt/FreeDMR/config/FreeDMR.cfg
+
+rm /opt/FreeDMR/conf.txt
+cd /opt/FreeDMR/
+mv loro.cfg /opt/FreeDMR/playback.cfg
+sudo sed -i 's/54915/49061/' /opt/FreeDMR/playback.cfg
+#sudo sed -i "121,129d" /opt/FreeDMR/playback.cfg
+#
+#sed '14 a VALIDATE_SERVER_IDS: True' -i /opt/FreeDMR/config/FreeDMR.cfg
+#sed '105 a override_ident_tg:' -i /opt/FreeDMR/config/FreeDMR.cfg
+
+#######lamp
+sudo apt install mariadb-server php libapache2-mod-php php-zip php-mbstring php-cli php-common php-curl php-xml php-mysql -y
+
+#sudo apt install apache2 -y
+#systemctl restar apache2
+#systemctl enable apache2
+systemctl restart mariadb
+systemctl enable mariadb
+#sudo mysql_secure_installation --host=localhost --port=3306
+echo "DROP USER emqte1@localhost" | /usr/bin/mysql -u root
+echo "DROP DATABASE selfcare" | /usr/bin/mysql -u root
+
+newUser='emqte1'
+newDbPassword=''
+newDb='selfcare'
+host=localhost
+#host='%'
+
+# MySQL 5.7 and earlier versions
+#commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';FLUSH PRIVILEGES;"
+
+# MySQL 8 and higher versions
+commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}';GRANT ALL ON \`${newDb}\`.* TO '${newUser}'@'${host}';FLUSH PRIVILEGES;"
+
+#cho "${commands}" | /usr/bin/mysql -u root -p
+echo "${commands}" | /usr/bin/mysql -u root
+###########################################
+#fdmr-monitor
+cd /opt
+sudo git clone https://github.com/yuvelq/FDMR-Monitor.git
+cd FDMR-Monitor
+sudo git checkout Self_Service
+sudo sed -i 's/RELOAD_TIME = 15/RELOAD_TIME = 1/' /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg
+sudo sed -i 's/FREQUENCY = 10/FREQUENCY = 120/' /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
+#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 cat > /opt/FDMR-Monitor/html/buttons.php <<- "EOF"
+
+Home
+
+
+
+
+
+ SelfService';}?>
+
Login
+ Devices';
+ }
+ ?>
+
+
+
+
+
+
+
+EOF
+
+#
+
+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
+sed '64 a #TGID_URL = https://freedmr.cymru/talkgroups/talkgroup_ids_flags_json.php' -i /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg
+cd /opt/FDMR-Monitor/
+sudo rm /opt/FDMR-Monitor/install.sh
+wget https://raw.githubusercontent.com/hp3icc/emq-TE1ws/main/self/install.sh
+sudo chmod +x /opt/FDMR-Monitor/install.sh
+sudo chmod +x /opt/FDMR-Monitor/*.py
+#
+sh /opt/FDMR-Monitor/install.sh
+sudo sh /opt/extra-2.sh
+#####################
+sudo sed -i "s/All rights reserved.
.*/All rights reserved.
\"2018\") {\$cdate=\"2018-\".date(\"Y\");} echo \$cdate; ?>\" target=\"_blank\" href=https:\/\/github.com\/hp3icc\/Easy-FreeDMR-SERVER-Install\/>Proyect: Easy-FreeDMR-SERVER-Install<\/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
+#sudo sed -i "56,63d" /opt/FreeDMR/config/FreeDMR.cfg
+#################
+
+#sed '33 a ' -i /var/www/html/sysinfo.php
+
+cp -r /opt/FDMR-Monitor/sysinfo/ /var/www/fdmr/sysinfo/
+
+#########
+sudo cat > /opt/FreeDMR/config/rules.py <<- "EOF"
+'''
+THIS EXAMPLE WILL NOT WORK AS IT IS - YOU MUST SPECIFY YOUR OWN VALUES!!!
+
+In FreeDMR, the rules file should be *empty* unless you have static routing required. Please see the
+documentation for more details.
+
+This file is organized around the "Conference Bridges" that you wish to use. If you're a c-Bridge
+person, think of these as "bridge groups". You might also liken them to a "reflector". If a particular
+system is "ACTIVE" on a particular conference bridge, any traffid from that system will be sent
+to any other system that is active on the bridge as well. This is not an "end to end" method, because
+each system must independently be activated on the bridge.
+
+The first level (e.g. "WORLDWIDE" or "STATEWIDE" in the examples) is the name of the conference
+bridge. This is any arbitrary ASCII text string you want to use. Under each conference bridge
+definition are the following items -- one line for each HBSystem as defined in the main HBlink
+configuration file.
+
+ * SYSTEM - The name of the sytem as listed in the main hblink configuration file (e.g. hblink.cfg)
+ This MUST be the exact same name as in the main config file!!!
+ * TS - Timeslot used for matching traffic to this confernce bridge
+ XLX connections should *ALWAYS* use TS 2 only.
+ * TGID - Talkgroup ID used for matching traffic to this conference bridge
+ XLX connections should *ALWAYS* use TG 9 only.
+ * ON and OFF are LISTS of Talkgroup IDs used to trigger this system off and on. Even if you
+ only want one (as shown in the ON example), it has to be in list format. None can be
+ handled with an empty list, such as " 'ON': [] ".
+ * TO_TYPE is timeout type. If you want to use timers, ON means when it's turned on, it will
+ turn off afer the timout period and OFF means it will turn back on after the timout
+ period. If you don't want to use timers, set it to anything else, but 'NONE' might be
+ a good value for documentation!
+ * TIMOUT is a value in minutes for the timout timer. No, I won't make it 'seconds', so don't
+ ask. Timers are performance "expense".
+ * RESET is a list of Talkgroup IDs that, in addition to the ON and OFF lists will cause a running
+ timer to be reset. This is useful if you are using different TGIDs for voice traffic than
+ triggering. If you are not, there is NO NEED to use this feature.
+'''
+
+BRIDGES = {
+
+ '9990': [
+ {'SYSTEM': 'EchoTest', 'TS': 2, 'TGID': 9990, 'ACTIVE':True, 'TIMEOUT': 0, 'TO_TYPE': 'NONE', 'ON': [], 'OFF': [], 'RESET': []},
+
+ ],
+
+
+}
+if __name__ == '__main__':
+ from pprint import pprint
+ pprint(BRIDGES)
+
+EOF
+##########################
+
+sudo cat > /lib/systemd/system/proxy.service <<- "EOF"
+[Unit]
+Description= Proxy Service
+
+After=multi-user.target
+
+
+[Service]
+User=root
+Type=simple
+Restart=always
+RestartSec=3
+StandardOutput=null
+ExecStartPre=/bin/sh -c 'until ping -c1 noip.com; do sleep 1; done;'
+#WorkingDirectory=/opt/FreeDMR
+#ExecStart=/usr/bin/python3 /opt/FreeDMR/hotspot_proxy_v2.py
+ExecStart=/usr/bin/python3 /opt/FreeDMR/hotspot_proxy_v2.py -c /opt/FreeDMR/proxy.cfg
+
+[Install]
+WantedBy=multi-user.target
+
+EOF
+#########
+sudo cat > /lib/systemd/system/freedmr.service <<- "EOF"
+[Unit]
+Description=FreeDmr
+After=multi-user.target
+
+[Service]
+User=root
+Type=simple
+Restart=always
+RestartSec=3
+StandardOutput=null
+ExecStartPre=/bin/sh -c 'until ping -c1 noip.com; do sleep 1; done;'
+ExecStart=/usr/bin/python3 /opt/FreeDMR/bridge_master.py -c /opt/FreeDMR/config/FreeDMR.cfg -r /opt/FreeDMR/config/rules.py
+
+[Install]
+WantedBy=multi-user.target
+
+EOF
+###
+sudo cat > /lib/systemd/system/fdmrparrot.service <<- "EOF"
+[Unit]
+
+Description=Freedmr Parrot
+
+After=network-online.target syslog.target
+
+Wants=network-online.target
+
+[Service]
+
+StandardOutput=null
+
+WorkingDirectory=/opt/FreeDMR
+
+RestartSec=3
+
+ExecStart=/usr/bin/python3 /opt/FreeDMR/playback.py -c /opt/FreeDMR/playback.cfg
+#/usr/bin/python3 /opt/HBlink3/playback.py -c /opt/HBlink3/playback.cfg
+
+Restart=on-abort
+
+[Install]
+
+WantedBy=multi-user.target
+
+EOF
+##############################
+
+sudo systemctl stop rsyslog
+sudo systemctl disable rsyslog
+sudo systemctl disable systemd-networkd-wait-online.service
+sudo systemctl disable dphys-swapfile-back.service
+mv /lib/systemd/system/dphys-swapfile.service /lib/systemd/system/dphys-swapfile-back.service
+rm /var/log/syslog*
+rm /var/log/*.log*
+
+(crontab -l; echo "* */1 * * * sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1")|awk '!x[$0]++'|crontab -
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/emq-TE1ws/main/self/data-id-update.sh)"
+data-id
+#####
+sudo update-rc.d dphys-swapfile remove
+sudo chmod -x /etc/init.d/dphys-swapfile
+sudo dphys-swapfile swapoff
+sudo swapoff -a
+sudo rm /var/swap
+sudo dphys-swapfile uninstall
+cd /etc/
+sudo sed -i 's/CONF_SWAPSIZE=100/CONF_SWAPSIZE=0/' dphys-swapfile
+cd /
+##################
+sudo systemctl daemon-reload
+systemctl start freedmr.service
+systemctl enable freedmr.service
+systemctl start proxy.service
+systemctl enable proxy.service
+systemctl start fdmrparrot.service
+systemctl enable fdmrparrot.service
+#################
+if [ -f "/opt/FDMR-Monitor/sysinfo/tempC.rrd" ]
+then
+ rm /opt/FDMR-Monitor/sysinfo/*.rrd
+elif
+ [ -f "/opt/FDMR-Monitor/sysinfo/load.rrd" ]
+then
+ rm /opt/FDMR-Monitor/sysinfo/*.rrd
+elif
+ [ -f "/opt/FDMR-Monitor/sysinfo/hdd.rrd" ]
+then
+ rm /opt/FDMR-Monitor/sysinfo/*.rrd
+fi
+
+sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh
+######################
+(crontab -l; echo "*/5 * * * * sh /opt/FDMR-Monitor/sysinfo/graph.sh")|awk '!x[$0]++'|crontab -
+(crontab -l; echo "*/2 * * * * sh /opt/FDMR-Monitor/sysinfo/cpu.sh")|awk '!x[$0]++'|crontab -
+(crontab -l; echo "* */6 * * * data-id")|awk '!x[$0]++'|crontab -
+
+sudo systemctl enable fdmr_mon.service
+#sudo systemctl restart apache2.service
+#sudo systemctl enable apache2.service
+sudo systemctl start fdmr_mon.service
+sudo systemctl restart http.server-fdmr.service
+sudo systemctl enable http.server-fdmr.service
+chmod +x /bin/menu*
+chmod +x /bin/MENU
+history -c && history -w
+menu
+#####
+
diff --git a/menu.sh b/menu.sh
index 5a76815..e843601 100644
--- a/menu.sh
+++ b/menu.sh
@@ -1,48 +1,48 @@
-sudo cat > /bin/menu <<- "EOF"
-#!/bin/bash
-while : ; do
-choix=$(whiptail --title "Raspbian Proyect HP3ICC EasyFreeDMR" --menu "move up or down with the keyboard arrows and select your option by pressing enter:" 23 56 13 \
-1 " Edit FreeDMR Server " \
-2 " Edit Interlink " \
-3 " Edit FDMR-Monitor " \
-4 " Edit Port HTTP " \
-5 " Parrot on " \
-6 " Parrot off " \
-7 " Restart FreeDMR Server " \
-8 " Restart FDMR-Monitor " \
-9 " Menu update " 3>&1 1>&2 2>&3)
-exitstatus=$?
-#on recupere ce choix
-#exitstatus=$?
-if [ $exitstatus = 0 ]; then
- echo "Your chosen option:" $choix
-else
- echo "You chose cancel."; break;
-fi
-# case : action en fonction du choix
-case $choix in
-1)
-sudo nano /opt/FreeDMR/config/FreeDMR.cfg ;;
-2)
-sudo nano /opt/FreeDMR/config/rules.py ;;
-3)
-sudo nano /opt/FDMR-Monitor/fdmr-mon.cfg ;;
-4)
-sudo nano /lib/systemd/system/http.server-fdmr.service && systemctl daemon-reload && systemctl restart http.server-fdmr.service ;;
-5)
-sudo systemctl stop fdmrparrot.service && sudo systemctl start fdmrparrot.service && sudo systemctl enable fdmrparrot.service ;;
-6)
-sudo systemctl stop fdmrparrot.service && sudo systemctl disable fdmrparrot.service ;;
-7)
-sudo systemctl stop proxy.service && sudo systemctl start proxy.service && sudo systemctl enable proxy.service && sudo systemctl stop freedmr.service && sudo systemctl start freedmr.service && sudo systemctl enable freedmr.service ;;
-8)
-sudo systemctl stop fdmr_mon.service && sudo rm /opt/FDMR-Monitor/sysinfo/*.rrd && sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh && cronedit.sh '*/5 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/graph.sh' add && cronedit.sh '*/2 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/cpu.sh' add && sudo systemctl enable fdmr_mon.service && sudo systemctl restart http.server-fdmr.service && sudo systemctl enable http.server-fdmr.service && sudo systemctl start fdmr_mon.service;;
-9)
-sh -c "$(curl -fsSL https://github.com/hp3icc/Easy-FreeDMR-SERVER-Install/raw/main/update.sh)";
-esac
-done
-exit 0
-EOF
-###
-chmod +x /bin/menu
-ln -s /bin/menu /bin/MENU
+sudo cat > /bin/menu <<- "EOF"
+#!/bin/bash
+while : ; do
+choix=$(whiptail --title "Raspbian Proyect HP3ICC EasyFreeDMR" --menu "move up or down with the keyboard arrows and select your option by pressing enter:" 23 56 13 \
+1 " Edit FreeDMR Server " \
+2 " Edit Interlink " \
+3 " Edit FDMR-Monitor " \
+4 " Edit Port HTTP " \
+5 " Parrot on " \
+6 " Parrot off " \
+7 " Restart FreeDMR Server " \
+8 " Restart FDMR-Monitor " \
+9 " Menu update " 3>&1 1>&2 2>&3)
+exitstatus=$?
+#on recupere ce choix
+#exitstatus=$?
+if [ $exitstatus = 0 ]; then
+ echo "Your chosen option:" $choix
+else
+ echo "You chose cancel."; break;
+fi
+# case : action en fonction du choix
+case $choix in
+1)
+sudo nano /opt/FreeDMR/config/FreeDMR.cfg ;;
+2)
+sudo nano /opt/FreeDMR/config/rules.py ;;
+3)
+sudo nano /opt/FDMR-Monitor/fdmr-mon.cfg ;;
+4)
+sudo nano /lib/systemd/system/http.server-fdmr.service && systemctl daemon-reload && systemctl restart http.server-fdmr.service ;;
+5)
+sudo systemctl stop fdmrparrot.service && sudo systemctl start fdmrparrot.service && sudo systemctl enable fdmrparrot.service ;;
+6)
+sudo systemctl stop fdmrparrot.service && sudo systemctl disable fdmrparrot.service ;;
+7)
+sudo systemctl stop proxy.service && sudo systemctl start proxy.service && sudo systemctl enable proxy.service && sudo systemctl stop freedmr.service && sudo systemctl start freedmr.service && sudo systemctl enable freedmr.service && cronedit.sh '* */6 * * *' 'data-id' add;;
+8)
+sudo systemctl stop fdmr_mon.service && sudo rm /opt/FDMR-Monitor/sysinfo/*.rrd && sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh && cronedit.sh '*/5 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/graph.sh' add && cronedit.sh '*/2 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/cpu.sh' add && sudo systemctl enable fdmr_mon.service && sudo systemctl restart http.server-fdmr.service && sudo systemctl enable http.server-fdmr.service && sudo systemctl start fdmr_mon.service;;
+9)
+sh -c "$(curl -fsSL https://github.com/hp3icc/Easy-FreeDMR-SERVER-Install/raw/main/update.sh)";
+esac
+done
+exit 0
+EOF
+###
+chmod +x /bin/menu
+ln -s /bin/menu /bin/MENU
diff --git a/selfservice-update.sh b/selfservice-update.sh
index 4ba7e74..f58a4e1 100644
--- a/selfservice-update.sh
+++ b/selfservice-update.sh
@@ -1,196 +1,195 @@
-#!/bin/sh
-if [ -f "/var/www/html/tgcount.php" ];
-then
- sudo systemctl stop apache2
- #echo "found file"
-else
- echo "file not found"
-
-fi
-if [ -f "/var/www/html/tgcount.php" ];
-then
- sudo systemctl disable apache2
- #echo "found file"
-else
- echo "file not found"
-
-fi
-if [ -f "/var/www/html/tgcount.php" ];
-then
- sudo rm /var/www/html/* -r
- #echo "found file"
-else
- echo "file not found"
-
-fi
-if [ -d "/var/www/fdmr" ];
-then
- sudo rm /var/www/fdmr/ -r
- #echo "found file"
-else
- echo "file not found"
-
-fi
-sudo systemctl stop fdmr_mon.service
-sudo systemctl stop proxy.service
-sudo systemctl stop http.server-fdmr.service
-sudo rm -r /opt/FDMR-Monitor/
-#
-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 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 = 120/' /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/www\/html/www\/fdmr/g" /opt/FDMR-Monitor/html/*.*
-sudo sed -i "s/www\/html/www\/fdmr/g" /opt/FDMR-Monitor/sysinfo/*.*
-####
-sudo sed -i 's/localhost_2-day.png/localhost_1-day.png/' /opt/FDMR-Monitor/html/sysinfo.php
-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
-
-
-
-
-
- SelfService';}?>
-
Login
- Devices';
- }
- ?>
-
-
-
-
-
-
-
-
-
-
-EOF
-
-#
-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
-sed '64 a #TGID_URL = https://freedmr.cymru/talkgroups/talkgroup_ids_flags_json.php' -i /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg
-sudo rm /opt/FDMR-Monitor/data/*
-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/All rights reserved.
.*/All rights reserved.
\"2018\") {\$cdate=\"2018-\".date(\"Y\");} echo \$cdate; ?>\" target=\"_blank\" href=https:\/\/github.com\/hp3icc\/Easy-FreeDMR-SERVER-Install\/>Proyect: Easy-FreeDMR-SERVER-Install<\/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
-#################
-#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/fdmr/sysinfo/
-sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/menu.sh)"
-#sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/emq-TE1ws/main/self/data-id-update.sh)"
-#data-id
-cronedit.sh '* */6 * * *' 'data-id' remove
-#sudo rm mon.db
-#sudo python3 mon_db.py
-sudo systemctl daemon-reload
-sudo systemctl start proxy.service
-sudo systemctl start fdmr_mon.service
-sudo systemctl enable fdmr_mon.service
-sudo systemctl start http.server-fdmr.service
-sudo systemctl enable http.server-fdmr.service
+#!/bin/sh
+if [ -f "/var/www/html/tgcount.php" ];
+then
+ sudo systemctl stop apache2
+ #echo "found file"
+else
+ echo "file not found"
+
+fi
+if [ -f "/var/www/html/tgcount.php" ];
+then
+ sudo systemctl disable apache2
+ #echo "found file"
+else
+ echo "file not found"
+
+fi
+if [ -f "/var/www/html/tgcount.php" ];
+then
+ sudo rm /var/www/html/* -r
+ #echo "found file"
+else
+ echo "file not found"
+
+fi
+if [ -d "/var/www/fdmr" ];
+then
+ sudo rm /var/www/fdmr/ -r
+ #echo "found file"
+else
+ echo "file not found"
+
+fi
+sudo systemctl stop fdmr_mon.service
+sudo systemctl stop proxy.service
+sudo systemctl stop http.server-fdmr.service
+sudo rm -r /opt/FDMR-Monitor/
+#
+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 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 = 120/' /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/www\/html/www\/fdmr/g" /opt/FDMR-Monitor/html/*.*
+sudo sed -i "s/www\/html/www\/fdmr/g" /opt/FDMR-Monitor/sysinfo/*.*
+####
+sudo sed -i 's/localhost_2-day.png/localhost_1-day.png/' /opt/FDMR-Monitor/html/sysinfo.php
+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
+
+
+
+
+
+ SelfService';}?>
+
Login
+ Devices';
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+EOF
+
+#
+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
+sed '64 a #TGID_URL = https://freedmr.cymru/talkgroups/talkgroup_ids_flags_json.php' -i /opt/FDMR-Monitor/fdmr-mon_SAMPLE.cfg
+sudo rm /opt/FDMR-Monitor/data/*
+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/All rights reserved.
.*/All rights reserved.
\"2018\") {\$cdate=\"2018-\".date(\"Y\");} echo \$cdate; ?>\" target=\"_blank\" href=https:\/\/github.com\/hp3icc\/Easy-FreeDMR-SERVER-Install\/>Proyect: Easy-FreeDMR-SERVER-Install<\/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
+#################
+#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/fdmr/html/sysinfo/
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/menu.sh)"
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/emq-TE1ws/main/self/data-id-update.sh)"
+data-id
+#sudo rm mon.db
+#sudo python3 mon_db.py
+sudo systemctl daemon-reload
+sudo systemctl start proxy.service
+sudo systemctl start fdmr_mon.service
+sudo systemctl enable fdmr_mon.service
+sudo systemctl start http.server-fdmr.service
+sudo systemctl enable http.server-fdmr.service
diff --git a/update.sh b/update.sh
index b011453..6d8d95a 100644
--- a/update.sh
+++ b/update.sh
@@ -1,104 +1,103 @@
-#!/bin/bash
-sudo cat > /bin/menu-update <<- "EOF"
-#!/bin/bash
-while : ; do
-choix=$(whiptail --title "Raspbian Proyect HP3ICC / update FDMR-Monitor OA4DOA" --menu "Nota Importante: antes de iniciar la actualizacion, el proceso de actualizacion borrara por completo todas las configuraciones, al finalizar la actualizacion el servicio se reinniciara automaticamente.
-" 17 50 4 \
-1 " Update FreeDMR " \
-2 " Update FDMR-Monitor " \
-3 " Menu Principal " 3>&1 1>&2 2>&3)
-exitstatus=$?
-#on recupere ce choix
-#exitstatus=$?
-if [ $exitstatus = 0 ]; then
- echo "Your chosen option:" $choix
-else
- echo "You chose cancel."; break;
-fi
-# case : action en fonction du choix
-case $choix in
-1)
-menu-up-fdm ;;
-2)
-menu-up-fdmon ;;
-3)
-break;
-esac
-done
-exit 0
-
-
-EOF
-#
-
-sudo cat > /bin/menu-up-fdm <<- "EOF"
-#!/bin/bash
-while : ; do
-choix=$(whiptail --title "Raspbian Proyect HP3ICC / update FreeDMR" --menu "Nota Importante: debe debe agregar todos sus obp en la opcion numero uno, ( 1-Lista de OBP )antes de iniciar la actualizacion, el proceso de actualizacion borrara por completo la carpeta /opt/FreeDMR, al finalizar la actualizacion el servicio Freedmr se reinniciara automaticamente.
-" 18 55 5 \
-1 " List OBP " \
-2 " List Rules " \
-3 " shell extra " \
-4 " Iniciar Actualizacion FreeDMR " \
-5 " Menu Principal " 3>&1 1>&2 2>&3)
-exitstatus=$?
-#on recupere ce choix
-#exitstatus=$?
-if [ $exitstatus = 0 ]; then
- echo "Your chosen option:" $choix
-else
- echo "You chose cancel."; break;
-fi
-# case : action en fonction du choix
-case $choix in
-1)
-sudo nano /opt/obp.txt ;;
-2)
-sudo nano /opt/rules.txt ;;
-3)
-sudo nano /opt/extra-1.sh && chmod +x /opt/extra* ;;
-4)
-sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/fdmr-update.sh)" ;;
-5)
-break;
-esac
-done
-exit 0
-EOF
-#
-#
-sudo cat > /bin/menu-up-fdmon <<- "EOF"
-#!/bin/bash
-while : ; do
-choix=$(whiptail --title "Raspbian Proyect HP3ICC / update FDMR-Monitor OA4DOA" --menu "Nota Importante: antes de iniciar la actualizacion, el proceso de actualizacion borrara por completo todas las configuraciones, al finalizar la actualizacion el servicio se reinniciara automaticamente.
-" 17 50 4 \
-1 " shell extra " \
-2 " Iniciar Actualizacion HBMon2 " \
-3 " Menu Principal " 3>&1 1>&2 2>&3)
-exitstatus=$?
-#on recupere ce choix
-#exitstatus=$?
-if [ $exitstatus = 0 ]; then
- echo "Your chosen option:" $choix
-else
- echo "You chose cancel."; break;
-fi
-# case : action en fonction du choix
-case $choix in
-1)
-sudo nano /opt/extra-2.sh && chmod +x /opt/extra* ;;
-2)
-sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/selfservice-update.sh)" ;;
-3)
-break;
-esac
-done
-exit 0
-
-
-EOF
-#
-
-#
-sudo chmod +x /bin/menu*
-menu-update
+sudo cat > /bin/menu-update <<- "EOF"
+#!/bin/bash
+while : ; do
+choix=$(whiptail --title "Raspbian Proyect HP3ICC / update FDMR-Monitor OA4DOA" --menu "Nota Importante: antes de iniciar la actualizacion, el proceso de actualizacion borrara por completo todas las configuraciones, al finalizar la actualizacion el servicio se reinniciara automaticamente.
+" 17 50 4 \
+1 " Update FreeDMR " \
+2 " Update FDMR-Monitor " \
+3 " Menu Principal " 3>&1 1>&2 2>&3)
+exitstatus=$?
+#on recupere ce choix
+#exitstatus=$?
+if [ $exitstatus = 0 ]; then
+ echo "Your chosen option:" $choix
+else
+ echo "You chose cancel."; break;
+fi
+# case : action en fonction du choix
+case $choix in
+1)
+menu-up-fdm ;;
+2)
+menu-up-fdmon ;;
+3)
+break;
+esac
+done
+exit 0
+
+
+EOF
+#
+
+sudo cat > /bin/menu-up-fdm <<- "EOF"
+#!/bin/bash
+while : ; do
+choix=$(whiptail --title "Raspbian Proyect HP3ICC / update FreeDMR" --menu "Nota Importante: debe debe agregar todos sus obp en la opcion numero uno, ( 1-Lista de OBP )antes de iniciar la actualizacion, el proceso de actualizacion borrara por completo la carpeta /opt/FreeDMR, al finalizar la actualizacion el servicio Freedmr se reinniciara automaticamente.
+" 18 55 5 \
+1 " List OBP " \
+2 " List Rules " \
+3 " shell extra " \
+4 " Iniciar Actualizacion FreeDMR " \
+5 " Menu Principal " 3>&1 1>&2 2>&3)
+exitstatus=$?
+#on recupere ce choix
+#exitstatus=$?
+if [ $exitstatus = 0 ]; then
+ echo "Your chosen option:" $choix
+else
+ echo "You chose cancel."; break;
+fi
+# case : action en fonction du choix
+case $choix in
+1)
+sudo nano /opt/obp.txt ;;
+2)
+sudo nano /opt/rules.txt ;;
+3)
+sudo nano /opt/extra-1.sh && chmod +x /opt/extra* ;;
+4)
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/fdmr-update.sh)" ;;
+5)
+break;
+esac
+done
+exit 0
+EOF
+#
+#
+sudo cat > /bin/menu-up-fdmon <<- "EOF"
+#!/bin/bash
+while : ; do
+choix=$(whiptail --title "Raspbian Proyect HP3ICC / update FDMR-Monitor OA4DOA" --menu "Nota Importante: antes de iniciar la actualizacion, el proceso de actualizacion borrara por completo todas las configuraciones, al finalizar la actualizacion el servicio se reinniciara automaticamente.
+" 17 50 4 \
+1 " shell extra " \
+2 " Iniciar Actualizacion HBMon2 " \
+3 " Menu Principal " 3>&1 1>&2 2>&3)
+exitstatus=$?
+#on recupere ce choix
+#exitstatus=$?
+if [ $exitstatus = 0 ]; then
+ echo "Your chosen option:" $choix
+else
+ echo "You chose cancel."; break;
+fi
+# case : action en fonction du choix
+case $choix in
+1)
+sudo nano /opt/extra-2.sh && chmod +x /opt/extra* ;;
+2)
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/Easy-FreeDMR-SERVER-Install/main/selfservice-update.sh)" ;;
+3)
+break;
+esac
+done
+exit 0
+
+
+EOF
+#
+
+#
+sudo chmod +x /bin/menu*
+menu-update