Create menu-ysf2dmr

This commit is contained in:
Esteban Mackay Q 2022-12-07 19:26:37 -05:00 committed by GitHub
parent 929e6289e8
commit 1863fa5604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 0 deletions

32
menu/menu-ysf2dmr Normal file
View File

@ -0,0 +1,32 @@
at > /bin/menu-ysf2dmr <<- "EOF"
#!/bin/bash
while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu YSF2DMR" --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion" 20 50 11 \
1 " Editar YSF2DMR " \
2 " Iniciar YSF2DMR " \
3 " Detener YSF2DMR " \
4 " 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/YSF2DMR/YSF2DMR.ini;;
2)
sudo systemctl stop dmrid-ysf2dmr.service && sudo systemctl start dmrid-ysf2dmr.service && sudo systemctl enable dmrid-ysf2dmr.service && cronedit.sh '0 3 * * *' 'sh /opt/YSF2DMR/DMRIDUpdate.sh' add ;;
3)
sudo systemctl stop dmrid-ysf2dmr.service && sudo systemctl disable dmrid-ysf2dmr.service && sudo systemctl stop ysf2dmr.service && rm /var/log/ysf2dmr/* && cronedit.sh '0 3 * * *' 'sh /opt/YSF2DMR/DMRIDUpdate.sh' remove ;;
4)
break;
esac
done
exit 0
EOF
###
chmod +x /bin/menu-ysf2dmr