Update menu-xlx

This commit is contained in:
Esteban Mackay Q 2023-12-10 16:29:00 -05:00
parent 029f7308c8
commit a974091395
1 changed files with 31 additions and 32 deletions

View File

@ -148,7 +148,14 @@ sudo systemctl restart nginx
if [[ ! "$XLXDOMAIN" =~ [a-zA-Z] ]]; then
w0dn0=""
fi
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
whiptail --title "Easy setup XLXD" --inputbox "What contrie your server? :" 10 60 2>/tmp/CONTRIE.txt
if [ $? -ne 0 ]; then
echo "Has elegido cancelar. Saliendo..."
@ -280,31 +287,31 @@ sed -i "s|XLX-EMAIL:.*|XLX-EMAIL: $EMAIL|g" $wdp
sed -i "s|XLX-CALLSIGN:.*|XLX-CALLSIGN: $CALLSIGN|g" $wdp
#dash1
sed -i "s|<title><?php echo.*|<title><?php echo \$Reflector->GetReflectorName(); ?> Reflector Dashboard / $DESCRIPTION</title>|" /opt/xlxd/dashboard/index.php
sed -i "s/NumberOfModules'] = 10/NumberOfModules'] = $NMODU/g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s/your_country/$CONTRIE/g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s/your_comment/$DESCRIPTION/g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s/'CustomTXT'] = ''/'CustomTXT'] = '$DESCRIPTION'/g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s/your_email/$EMAIL/g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s/LX1IQ/$CALLSIGN/g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s/http:\/\/your_dashboard/http:\/\/$DASH/g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s|NumberOfModules.*|NumberOfModules'] = $NMODU|g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s|your_country|$CONTRIE|g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s|your_comment|$DESCRIPTION|g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s|'CustomTXT.*|'CustomTXT'] = '$DESCRIPTION'|g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s|your_email|$EMAIL|g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s|LX1IQ|$CALLSIGN|g" /opt/xlxd/dashboard/pgs/config.inc.php
sed -i "s|CallingHome\['MyDashBoardURL.*|CallingHome\['MyDashBoardURL'\]\ = 'http:\/\/$DASH'|" /opt/xlxd/dashboard/pgs/config.inc.php
#dash2
sed -i "s|<title><?php echo.*|<title><?php echo \$Reflector->GetReflectorName(); ?> Reflector Dashboard / $DESCRIPTION</title>|" /opt/xlxd/dashboard2/index.php
sed -i "s/NumberOfModules'] = 10/NumberOfModules'] = $NMODU/g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s/your_country/$CONTRIE/g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s/your_comment/$DESCRIPTION/g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s/'CustomTXT'] = ''/'CustomTXT'] = '$DESCRIPTION'/g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s/your_email/$EMAIL/g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s/LX1IQ/$CALLSIGN/g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s/http:\/\/your_dashboard/http:\/\/$DASH/g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s|NumberOfModules.*|NumberOfModules'] = $NMODU|g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s|your_country|$CONTRIE|g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s|your_comment|$DESCRIPTION|g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s|'CustomTXT.*|'CustomTXT'] = '$DESCRIPTION'|g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s|your_email|$EMAIL|g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s|LX1IQ|$CALLSIGN|g" /opt/xlxd/dashboard2/pgs/config.inc.php
sed -i "s|CallingHome\['MyDashBoardURL.*|CallingHome\['MyDashBoardURL'\]\ = 'http:\/\/$DASH'|" /opt/xlxd/dashboard2/pgs/config.inc.php
#
sed -i "s/define YSF_PORT.*/define YSF_PORT $YSFPOR/g" /opt/xlxd/src/main.h
sed -i "s/MODULE .*/MODULE '$YSFMODU'/g" /opt/xlxd/src/main.h
sed -i "s/define NB_OF_MODULES.*/define NB_OF_MODULES $NMODU/g" /opt/xlxd/src/main.h
sed -i "s/define NB_MODULES_MAX.*/define NB_MODULES_MAX $NMODU/g" /opt/xlxd/src/main.h
sed -i "s/TRANSCODER_PORT.*/TRANSCODER_PORT $AMBPOR/g" /opt/xlxd/src/main.h
sed -i "s/YSF_DEFAULT_NODE_TX_FREQ.*/YSF_DEFAULT_NODE_TX_FREQ 434000000/g" /opt/xlxd/src/main.h
sed -i "s/YSF_DEFAULT_NODE_RX_FREQ.*/YSF_DEFAULT_NODE_RX_FREQ 434000000/g" /opt/xlxd/src/main.h
sed -i "s/define YSF_AUTOLINK_ENABLE.*/define YSF_AUTOLINK_ENABLE 1/g" /opt/xlxd/src/main.h
sed -i "s|define YSF_PORT.*|define YSF_PORT $YSFPOR|g" /opt/xlxd/src/main.h
sed -i "s|MODULE .*|MODULE '$YSFMODU'|g" /opt/xlxd/src/main.h
sed -i "s|define NB_OF_MODULES.*|define NB_OF_MODULES $NMODU|g" /opt/xlxd/src/main.h
sed -i "s|define NB_MODULES_MAX.*|define NB_MODULES_MAX $NMODU|g" /opt/xlxd/src/main.h
sed -i "s|TRANSCODER_PORT.*|TRANSCODER_PORT $AMBPOR|g" /opt/xlxd/src/main.h
sed -i "s|YSF_DEFAULT_NODE_TX_FREQ.*|YSF_DEFAULT_NODE_TX_FREQ 434000000|g" /opt/xlxd/src/main.h
sed -i "s|YSF_DEFAULT_NODE_RX_FREQ.*|YSF_DEFAULT_NODE_RX_FREQ 434000000|g" /opt/xlxd/src/main.h
sed -i "s|define YSF_AUTOLINK_ENABLE.*|define YSF_AUTOLINK_ENABLE 1|g" /opt/xlxd/src/main.h
#xlxd-start
cd /opt/xlxd/src/
make clean
@ -324,15 +331,7 @@ 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
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
else