#!/bin/bash
# MENU DE SELECTION POUR Spotnik-3.1
#
#  F5NLG  11/09/2020
#

while : ; do

choix=$(whiptail --title "Config Spotnik 3.1"  --menu "                    >> Make your Choice: " 20 60 14 \
1 " See Spotnik working (Logs) 'ctrl c'to leave" \
2 " Configure Wifi or network" \
3 " Trim Sound Alsamixer" \
4 " Edit Svxlink.cfg for all reflectors" \
5 " Edit Svxlink.el for EchoLink." \
6 " Edit ModuleEchoLink.conf" \
7 " Edit Airport for meteo" \
8 " MC Midnight Commander" \
9 " Configure mail account for Propagation Monitor" \
10 " Configure Dwagent" \
11 " Return to Spot Menu" 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)
/etc/spotnik/view_svx ;;

2)
nmtui ;;

3)
alsamixer && alsactl store ;;

4)
mcedit /etc/spotnik/svxlink.cfg ;;

5)
mcedit /etc/spotnik/svxlink.el ;;

6)
mcedit /etc/spotnik/svxlink.d/ModuleEchoLink.conf ;;

7)
mcedit /etc/spotnik/svxlink.d/ModuleMetarInfo.conf ;;

8)
mc /etc/spotnik ;;

9)
fetchsetup ;;

10)
sh /usr/share/dwagent/native/configure ;;

11)
break ;;

esac

done
exit 0
