Update update.sh

main
hp3icc 1 week ago
parent bf6cd5a604
commit 1dde7b9e66

@ -357,18 +357,23 @@ echo "${commands}" | /usr/bin/mysql -u root
cd /
if [ -f "/opt/FreeDMR/config/FreeDMR.cfg" ]
then
variable=$(grep "SERVER_ID:" /opt/FreeDMR/config/FreeDMR.cfg | grep -Eo '[0-9]{1,9}')
SERVER_ID=$(grep "SERVER_ID:" /opt/FreeDMR/config/FreeDMR.cfg | grep -Eo '[0-9]{1,9}')
fi
if [ -f "/opt/adn-server/config/adn.cfg" ]
then
variable=$(grep "SERVER_ID:" /opt/adn-server/config/adn.cfg | grep -Eo '[0-9]{1,9}')
SERVER_ID=$(grep "SERVER_ID:" /opt/adn-server/config/adn.cfg | grep -Eo '[0-9]{1,9}')
fi
if [ -f "/opt/ADN-DMR-Peer-Server/config/adn.cfg" ]
then
variable=$(grep "SERVER_ID:" /opt/ADN-DMR-Peer-Server/config/adn.cfg | grep -Eo '[0-9]{1,9}')
SERVER_ID=$(grep "SERVER_ID:" /opt/ADN-DMR-Peer-Server/config/adn.cfg | grep -Eo '[0-9]{1,9}')
URL_SECURITY=$(grep "URL_SECURITY:" /opt/ADN-DMR-Peer-Server/config/adn.cfg | grep -oP '(?<=URL_SECURITY:\s).*')
PORT_SECURITY=$(grep "PORT_SECURITY:" /opt/ADN-DMR-Peer-Server/config/adn.cfg | grep -Eo '[0-9]{1,5}')
PASS_SECURITY=$(grep "PASS_SECURITY:" /opt/ADN-DMR-Peer-Server/config/adn.cfg | grep -oP '(?<=PASS_SECURITY:\s).*')
USERS_PASS=$(grep "USERS_PASS:" /opt/ADN-DMR-Peer-Server/config/adn.cfg | grep -oP '(?<=USERS_PASS:\s).*')
HASH_ENCRYPT=$(grep "HASH_ENCRYPT:" /opt/ADN-DMR-Peer-Server/config/adn.cfg | grep -oP '(?<=HASH_ENCRYPT:\s).*')
fi
if [ -z "$variable" ]
then variable=0000
if [ -z "$SERVER_ID" ]
then SERVER_ID=0000
fi
SERVICIOS="adn-server.service freedmr.service proxy.service adn-parrot.service fdmrparrot.service adn_server.service adn_proxy.service adn_parrot.service"
@ -510,7 +515,12 @@ if [ -f "/etc/os-release" ]; then
fi
####
cp /opt/ADN-DMR-Peer-Server/config/ADN-SAMPLE.cfg /opt/ADN-DMR-Peer-Server/config/adn.cfg
sudo sed -i "s/SERVER_ID:.*/SERVER_ID: $variable/g" /opt/ADN-DMR-Peer-Server/config/adn.cfg
sudo sed -i "s|SERVER_ID:.*|SERVER_ID: $SERVER_ID|g" /opt/ADN-DMR-Peer-Server/config/adn.cfg
sudo sed -i "s|URL_SECURITY:.*|URL_SECURITY: $URL_SECURITY|g" /opt/ADN-DMR-Peer-Server/config/adn.cfg
sudo sed -i "s|PORT_SECURITY:.*|PORT_SECURITY: $PORT_SECURITY|g" /opt/ADN-DMR-Peer-Server/config/adn.cfg
sudo sed -i "s|PASS_SECURITY:.*|PASS_SECURITY: $PASS_SECURITY|g" /opt/ADN-DMR-Peer-Server/config/adn.cfg
sudo sed -i "s|USERS_PASS:.*|USERS_PASS: $USERS_PASS|g" /opt/ADN-DMR-Peer-Server/config/adn.cfg
sudo sed -i "s|HASH_ENCRYPT:.*|HASH_ENCRYPT: $HASH_ENCRYPT|g" /opt/ADN-DMR-Peer-Server/config/adn.cfg
sudo cat /opt/obp.txt >> /opt/ADN-DMR-Peer-Server/config/adn.cfg
cd /opt/ADN-DMR-Peer-Server/

Loading…
Cancel
Save

Powered by TurnKey Linux.