mirror of https://gitlab.com/hp3icc/emq-TE1.git
Update menu-dvs
This commit is contained in:
parent
ea64275382
commit
1e82f9f2cb
460
menu/menu-dvs
460
menu/menu-dvs
|
|
@ -20,6 +20,455 @@ choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota :
|
||||||
2 " Apagar Dvswitch " \
|
2 " Apagar Dvswitch " \
|
||||||
3 " Editar Dvswitch Server " \
|
3 " Editar Dvswitch Server " \
|
||||||
4 " Cambiar Puerto http & dns de Dashboard " \
|
4 " Cambiar Puerto http & dns de Dashboard " \
|
||||||
|
5 " Start Dashboard " \
|
||||||
|
6 " Dashboard off " \
|
||||||
|
7 " Menu Principal " 3>&1 1>&2 2>&3)
|
||||||
|
exitstatus=$?
|
||||||
|
|
||||||
|
if [ $exitstatus = 0 ]; then
|
||||||
|
echo "Your chosen option:" $choix
|
||||||
|
else
|
||||||
|
echo "You chose cancel."
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $choix in
|
||||||
|
1)
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Lista de servicios a reiniciar
|
||||||
|
servicios=("md380-emu.service" "analog_bridge.service" "mmdvm_bridge.service" "nxdngateway.service" "p25gateway.service" "ysfgateway.service" "quantar_bridge.service" "ircddbgatewayd.service" "p25parrot.service" "ysfparrot.service" "nxdnparrot.service")
|
||||||
|
|
||||||
|
# Recorre la lista de servicios y verifica si están activos
|
||||||
|
for servicio in "${servicios[@]}"; do
|
||||||
|
if systemctl status "$servicio" | grep "service; enabled;" >/dev/null 2>&1; then
|
||||||
|
echo "restart $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
else
|
||||||
|
echo "start $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
sudo systemctl enable "$servicio"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Lista de servicios a reiniciar
|
||||||
|
servicios=("md380-emu.service" "analog_bridge.service" "mmdvm_bridge.service" "nxdngateway.service" "p25gateway.service" "ysfgateway.service" "quantar_bridge.service" "ircddbgatewayd.service" "p25parrot.service" "ysfparrot.service" "nxdnparrot.service")
|
||||||
|
|
||||||
|
# Recorre la lista de servicios y verifica si están activos
|
||||||
|
for servicio in "${servicios[@]}"; do
|
||||||
|
if systemctl status "$servicio" | grep "service; enabled;" >/dev/null 2>&1; then
|
||||||
|
echo "stop $servicio"
|
||||||
|
sudo systemctl disable "$servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
rm /var/log/mmdvm/*;;
|
||||||
|
3)
|
||||||
|
sudo /usr/local/dvs/dvs ;;
|
||||||
|
4)
|
||||||
|
wdp=/opt/wdp3
|
||||||
|
if [ -f "/tmp/w0dn0.txt" ]; then
|
||||||
|
rm /tmp/w0dn0.txt
|
||||||
|
fi
|
||||||
|
if [ -f "/tmp/wd0p.txt" ]; then
|
||||||
|
rm /tmp/wd0p.txt
|
||||||
|
fi
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/$wsn0" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
|
||||||
|
whiptail --title "Setup Webserver" --inputbox "Select HTTP port:" 10 60 2>/tmp/wd0p.txt
|
||||||
|
exitstatus=$?
|
||||||
|
|
||||||
|
if [ $exitstatus != 0 ]; then
|
||||||
|
echo "You chose cancel. Exiting..."
|
||||||
|
exit 1 # Salir del script con un código de error
|
||||||
|
fi
|
||||||
|
|
||||||
|
wd0p=$(cat /tmp/wd0p.txt)
|
||||||
|
|
||||||
|
whiptail --title "Setup Webserver" --inputbox "DNS name:" 10 60 2>/tmp/w0dn0.txt
|
||||||
|
exitstatus=$?
|
||||||
|
|
||||||
|
if [ $exitstatus != 0 ]; then
|
||||||
|
echo "You chose cancel. Exiting..."
|
||||||
|
exit 1 # Salir del script con un código de error
|
||||||
|
fi
|
||||||
|
|
||||||
|
w0dn0=$(cat /tmp/w0dn0.txt)
|
||||||
|
|
||||||
|
sed -i "s|Web-Dashboar-Port:.*|Web-Dashboar-Port: $wd0p|g" $wdp
|
||||||
|
sed -i "s|Web-Dashboar-dns:.*|Web-Dashboar-dns: $w0dn0|g" $wdp
|
||||||
|
wd0p=$(grep "Web-Dashboar-Port:" $wdp | grep -oP 'Web-Dashboar-Port:\s*\K.*')
|
||||||
|
if [ -z "$wd0p" ]
|
||||||
|
then wd0p=80
|
||||||
|
|
||||||
|
fi
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
w0dn0=$(grep "Web-Dashboar-dns:" $wdp | grep -oP 'Web-Dashboar-dns:\s*\K.*')
|
||||||
|
w0d0=$(grep "Web-Dashboar-dir:" $wdp | grep -oP 'Web-Dashboar-dir:\s*\K.*')
|
||||||
|
if [ -z "$w0dn0" ]; then
|
||||||
|
if sudo netstat -tuln | grep -q "0.0.0.0:$wd0p "; then
|
||||||
|
whiptail --title "Check Port" --msgbox "El puerto $wd0p está ocupado. The port $wd0p is busy" 0 50
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
sudo ln -sf /etc/nginx/sites-available/000 /etc/nginx/sites-enabled/$wsn0
|
||||||
|
if [ ! -z "$w0dn0" ]; then
|
||||||
|
sudo sed -i '3i\ server_name w0dn0;' /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
sed -i "s|wsn0|$wsn0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|wd0p|$wd0p|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|w0dn0|$w0dn0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|w0d0|$w0d0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
# Lista de servicios a reiniciar
|
||||||
|
servicios=("webproxy.service" "monit.service")
|
||||||
|
|
||||||
|
# Recorre la lista de servicios y verifica si están activos
|
||||||
|
for servicio in "${servicios[@]}"; do
|
||||||
|
if systemctl status "$servicio" | grep "service; enabled;" >/dev/null 2>&1; then
|
||||||
|
echo "restart $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
else
|
||||||
|
echo "start $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
sudo systemctl enable "$servicio"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
5)
|
||||||
|
wdp=/opt/wdp3
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/$wsn0" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
|
||||||
|
wd0p=$(grep "Web-Dashboar-Port:" $wdp | grep -oP 'Web-Dashboar-Port:\s*\K.*')
|
||||||
|
if [ -z "$wd0p" ]
|
||||||
|
then wd0p=80
|
||||||
|
|
||||||
|
fi
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
w0dn0=$(grep "Web-Dashboar-dns:" $wdp | grep -oP 'Web-Dashboar-dns:\s*\K.*')
|
||||||
|
w0d0=$(grep "Web-Dashboar-dir:" $wdp | grep -oP 'Web-Dashboar-dir:\s*\K.*')
|
||||||
|
if [ -z "$w0dn0" ]; then
|
||||||
|
if sudo netstat -tuln | grep -q "0.0.0.0:$wd0p "; then
|
||||||
|
whiptail --title "Check Port" --msgbox "El puerto $wd0p está ocupado. The port $wd0p is busy" 0 50
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
sudo ln -sf /etc/nginx/sites-available/000 /etc/nginx/sites-enabled/$wsn0
|
||||||
|
if [ ! -z "$w0dn0" ]; then
|
||||||
|
sudo sed -i '3i\ server_name w0dn0;' /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
sed -i "s|wsn0|$wsn0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|wd0p|$wd0p|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|w0dn0|$w0dn0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|w0d0|$w0d0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
# Lista de servicios a reiniciar
|
||||||
|
servicios=("webproxy.service" "monit.service")
|
||||||
|
|
||||||
|
# Recorre la lista de servicios y verifica si están activos
|
||||||
|
for servicio in "${servicios[@]}"; do
|
||||||
|
if systemctl status "$servicio" | grep "service; enabled;" >/dev/null 2>&1; then
|
||||||
|
echo "restart $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
else
|
||||||
|
echo "start $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
sudo systemctl enable "$servicio"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
6)
|
||||||
|
wdp=/opt/wdp3
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/$wsn0" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
# Lista de servicios a reiniciar
|
||||||
|
servicios=("webproxy.service" "monit.service")
|
||||||
|
# Recorre la lista de servicios y verifica si están activos
|
||||||
|
for servicio in "${servicios[@]}"; do
|
||||||
|
if systemctl status "$servicio" | grep "service; enabled;" >/dev/null 2>&1; then
|
||||||
|
echo "stop $servicio"
|
||||||
|
sudo systemctl disable "$servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
7)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
exit 0
|
||||||
|
EOF3
|
||||||
|
#
|
||||||
|
if [ -f "/usr/local/dvs/dvsmu" ]
|
||||||
|
then
|
||||||
|
sudo cat > /bin/menu-dvs <<- "EOFR"
|
||||||
|
#!/bin/bash
|
||||||
|
while : ; do
|
||||||
|
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
|
||||||
|
1 " Encender Dvswitch " \
|
||||||
|
2 " Apagar Dvswitch " \
|
||||||
|
3 " Editar Dvswitch Server " \
|
||||||
|
4 " Editar DVSMU Server " \
|
||||||
|
5 " Cambiar Puerto http & dns de Dashboard " \
|
||||||
|
6 " Start Dashboard " \
|
||||||
|
7 " Dashboard off " \
|
||||||
|
8 " Menu Principal " 3>&1 1>&2 2>&3)
|
||||||
|
exitstatus=$?
|
||||||
|
|
||||||
|
if [ $exitstatus = 0 ]; then
|
||||||
|
echo "Your chosen option:" $choix
|
||||||
|
else
|
||||||
|
echo "You chose cancel."
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $choix in
|
||||||
|
1)
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Lista de servicios a reiniciar
|
||||||
|
servicios=("md380-emu.service" "analog_bridge.service" "mmdvm_bridge.service" "nxdngateway.service" "p25gateway.service" "ysfgateway.service" "quantar_bridge.service" "ircddbgatewayd.service" "p25parrot.service" "ysfparrot.service" "nxdnparrot.service")
|
||||||
|
|
||||||
|
# Recorre la lista de servicios y verifica si están activos
|
||||||
|
for servicio in "${servicios[@]}"; do
|
||||||
|
if systemctl status "$servicio" | grep "service; enabled;" >/dev/null 2>&1; then
|
||||||
|
echo "restart $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
else
|
||||||
|
echo "start $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
sudo systemctl enable "$servicio"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Lista de servicios a reiniciar
|
||||||
|
servicios=("md380-emu.service" "analog_bridge.service" "mmdvm_bridge.service" "nxdngateway.service" "p25gateway.service" "ysfgateway.service" "quantar_bridge.service" "ircddbgatewayd.service" "p25parrot.service" "ysfparrot.service" "nxdnparrot.service")
|
||||||
|
|
||||||
|
# Recorre la lista de servicios y verifica si están activos
|
||||||
|
for servicio in "${servicios[@]}"; do
|
||||||
|
if systemctl status "$servicio" | grep "service; enabled;" >/dev/null 2>&1; then
|
||||||
|
echo "stop $servicio"
|
||||||
|
sudo systemctl disable "$servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
rm /var/log/mmdvm/*;;
|
||||||
|
3)
|
||||||
|
sudo /usr/local/dvs/dvs ;;
|
||||||
|
4)
|
||||||
|
sudo /usr/local/dvs/dvsmu ;;
|
||||||
|
5)
|
||||||
|
wdp=/opt/wdp3
|
||||||
|
if [ -f "/tmp/w0dn0.txt" ]; then
|
||||||
|
rm /tmp/w0dn0.txt
|
||||||
|
fi
|
||||||
|
if [ -f "/tmp/wd0p.txt" ]; then
|
||||||
|
rm /tmp/wd0p.txt
|
||||||
|
fi
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/$wsn0" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
|
||||||
|
whiptail --title "Setup Webserver" --inputbox "Select HTTP port:" 10 60 2>/tmp/wd0p.txt
|
||||||
|
exitstatus=$?
|
||||||
|
|
||||||
|
if [ $exitstatus != 0 ]; then
|
||||||
|
echo "You chose cancel. Exiting..."
|
||||||
|
exit 1 # Salir del script con un código de error
|
||||||
|
fi
|
||||||
|
|
||||||
|
wd0p=$(cat /tmp/wd0p.txt)
|
||||||
|
|
||||||
|
whiptail --title "Setup Webserver" --inputbox "DNS name:" 10 60 2>/tmp/w0dn0.txt
|
||||||
|
exitstatus=$?
|
||||||
|
|
||||||
|
if [ $exitstatus != 0 ]; then
|
||||||
|
echo "You chose cancel. Exiting..."
|
||||||
|
exit 1 # Salir del script con un código de error
|
||||||
|
fi
|
||||||
|
|
||||||
|
w0dn0=$(cat /tmp/w0dn0.txt)
|
||||||
|
|
||||||
|
sed -i "s|Web-Dashboar-Port:.*|Web-Dashboar-Port: $wd0p|g" $wdp
|
||||||
|
sed -i "s|Web-Dashboar-dns:.*|Web-Dashboar-dns: $w0dn0|g" $wdp
|
||||||
|
wd0p=$(grep "Web-Dashboar-Port:" $wdp | grep -oP 'Web-Dashboar-Port:\s*\K.*')
|
||||||
|
if [ -z "$wd0p" ]
|
||||||
|
then wd0p=80
|
||||||
|
|
||||||
|
fi
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
w0dn0=$(grep "Web-Dashboar-dns:" $wdp | grep -oP 'Web-Dashboar-dns:\s*\K.*')
|
||||||
|
w0d0=$(grep "Web-Dashboar-dir:" $wdp | grep -oP 'Web-Dashboar-dir:\s*\K.*')
|
||||||
|
if [ -z "$w0dn0" ]; then
|
||||||
|
if sudo netstat -tuln | grep -q "0.0.0.0:$wd0p "; then
|
||||||
|
whiptail --title "Check Port" --msgbox "El puerto $wd0p está ocupado. The port $wd0p is busy" 0 50
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
sudo ln -sf /etc/nginx/sites-available/000 /etc/nginx/sites-enabled/$wsn0
|
||||||
|
if [ ! -z "$w0dn0" ]; then
|
||||||
|
sudo sed -i '3i\ server_name w0dn0;' /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
sed -i "s|wsn0|$wsn0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|wd0p|$wd0p|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|w0dn0|$w0dn0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|w0d0|$w0d0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
;;
|
||||||
|
6)
|
||||||
|
wdp=/opt/wdp3
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/$wsn0" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
|
||||||
|
wd0p=$(grep "Web-Dashboar-Port:" $wdp | grep -oP 'Web-Dashboar-Port:\s*\K.*')
|
||||||
|
if [ -z "$wd0p" ]
|
||||||
|
then wd0p=80
|
||||||
|
|
||||||
|
fi
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
w0dn0=$(grep "Web-Dashboar-dns:" $wdp | grep -oP 'Web-Dashboar-dns:\s*\K.*')
|
||||||
|
w0d0=$(grep "Web-Dashboar-dir:" $wdp | grep -oP 'Web-Dashboar-dir:\s*\K.*')
|
||||||
|
if [ -z "$w0dn0" ]; then
|
||||||
|
if sudo netstat -tuln | grep -q "0.0.0.0:$wd0p "; then
|
||||||
|
whiptail --title "Check Port" --msgbox "El puerto $wd0p está ocupado. The port $wd0p is busy" 0 50
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
sudo ln -sf /etc/nginx/sites-available/000 /etc/nginx/sites-enabled/$wsn0
|
||||||
|
if [ ! -z "$w0dn0" ]; then
|
||||||
|
sudo sed -i '3i\ server_name w0dn0;' /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
sed -i "s|wsn0|$wsn0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|wd0p|$wd0p|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|w0dn0|$w0dn0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
sed -i "s|w0d0|$w0d0|g" /etc/nginx/sites-enabled/$wsn0
|
||||||
|
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
# Lista de servicios a reiniciar
|
||||||
|
servicios=("webproxy.service" "monit.service")
|
||||||
|
|
||||||
|
# Recorre la lista de servicios y verifica si están activos
|
||||||
|
for servicio in "${servicios[@]}"; do
|
||||||
|
if systemctl status "$servicio" | grep "service; enabled;" >/dev/null 2>&1; then
|
||||||
|
echo "restart $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
else
|
||||||
|
echo "start $servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
sudo systemctl start "$servicio"
|
||||||
|
sudo systemctl enable "$servicio"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
7)
|
||||||
|
wdp=/opt/wdp3
|
||||||
|
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/$wsn0" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/$wsn0
|
||||||
|
fi
|
||||||
|
if [ -f "/etc/nginx/sites-enabled/000" ]; then
|
||||||
|
rm /etc/nginx/sites-enabled/000
|
||||||
|
fi
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
# Lista de servicios a reiniciar
|
||||||
|
servicios=("webproxy.service" "monit.service")
|
||||||
|
# Recorre la lista de servicios y verifica si están activos
|
||||||
|
for servicio in "${servicios[@]}"; do
|
||||||
|
if systemctl status "$servicio" | grep "service; enabled;" >/dev/null 2>&1; then
|
||||||
|
echo "stop $servicio"
|
||||||
|
sudo systemctl disable "$servicio"
|
||||||
|
sudo systemctl stop "$servicio"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
9)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
EOFR
|
||||||
|
if [ -d "/var/www/dvs/qrz_photo/" ]
|
||||||
|
then
|
||||||
|
sudo cat > /bin/menu-dvs <<- "EOF3"
|
||||||
|
#!/bin/bash
|
||||||
|
while : ; do
|
||||||
|
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
|
||||||
|
1 " Encender Dvswitch " \
|
||||||
|
2 " Apagar Dvswitch " \
|
||||||
|
3 " Editar Dvswitch Server " \
|
||||||
|
4 " Cambiar Puerto http & dns de Dashboard " \
|
||||||
5 " Start Dashboard Full " \
|
5 " Start Dashboard Full " \
|
||||||
6 " Dashboard off " \
|
6 " Dashboard off " \
|
||||||
7 " Start Dashboard no Buttons " \
|
7 " Start Dashboard no Buttons " \
|
||||||
|
|
@ -301,10 +750,11 @@ esac
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
EOF3
|
EOF3
|
||||||
#
|
fi
|
||||||
if [ -f "/usr/local/dvs/dvsmu" ]
|
if [ -d "/var/www/dvs/qrz_photo/" ]; then
|
||||||
then
|
if [ -f "/usr/local/dvs/dvsmu" ]; then
|
||||||
sudo cat > /bin/menu-dvs <<- "EOFR"
|
# Avanzar con el script si el directorio y el archivo existen
|
||||||
|
sudo cat > /bin/menu-dvs <<- "EOFR"
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
while : ; do
|
while : ; do
|
||||||
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
|
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
|
||||||
|
|
@ -581,6 +1031,8 @@ done
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
EOFR
|
EOFR
|
||||||
|
fi
|
||||||
|
fi
|
||||||
for i in {01..40}; do
|
for i in {01..40}; do
|
||||||
archivo="/opt/user$i/MMDVM_Bridge.ini"
|
archivo="/opt/user$i/MMDVM_Bridge.ini"
|
||||||
if [ -e "$archivo" ]; then
|
if [ -e "$archivo" ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue