Create dv-list-tg.sh

This commit is contained in:
Esteban Mackay Q 2022-07-27 22:25:35 -05:00 committed by GitHub
parent 1f3c1fed6c
commit 083eacb414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 0 deletions

31
service/dv-list-tg.sh Normal file
View File

@ -0,0 +1,31 @@
sudo cat > /bin/menu-update <<- "EOF"
#!/bin/bash
while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu TG List DVSwitch" --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion, al finalizar debe actualizar la lista de tg en su DVSwitch Mobile. " 17 50 5 \
1 " List TG FreeDMR " \
2 " List TG Brandmeister " \
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 sed -i "s/www.pistar.uk/freedmr-hp.ddns.net/g" /opt/MMDVM_Bridge/dvswitch.sh ;;
2)
sudo sed -i "s/freedmr-hp.ddns.net/www.pistar.uk/g" /opt/MMDVM_Bridge/dvswitch.sh ;;
3)
break;
esac
done
exit 0
EOF
####
chmod +x /bin/menu-update
/bin/menu-update