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

while : ; do

choix=$(whiptail --title "Spotnik Menu 3.1"  --menu "                    >> Make your Choice: " 20 60 14 \
1 " Restart Spotnik on Parrot    '95'" \
2 " Restart Spotnik on RRF Room  '96'" \
3 " Restart Spotnik on FON Room  '97'" \
4 " Restart Spotnik on TEC Room  '98'" \
5 " Restart Spotnik on INT Room  '99'" \
6 " Restart Spotnik on BAV Room  '100'" \
7 " Restart Spotnik on LOC Room  '101'" \
8 " Restart Spotnik on EXP Room  '102'" \
9 " Restart Spotnik on EchoLink  '103'" \
10 " Restart Spotnik on REG Room  '104'" \
11 " Start / Stop RRF Raptor      '200'" \
12 " See Spotnik working (Logs) 'ctrl c'to leave" \
13 " Configure Spotnik" 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/restart.default ;;

2)
/etc/spotnik/restart.rrf ;;

3)
/etc/spotnik/restart.fon ;;

4)
/etc/spotnik/restart.tec ;;

5)
/etc/spotnik/restart.int ;;

6)
/etc/spotnik/restart.bav ;;

7)
/etc/spotnik/restart.loc ;;

8)
/etc/spotnik/restart.exp ;;

9)
/etc/spotnik/restart.el ;;

10)
/etc/spotnik/restart.reg ;;

11)
/opt/RRFRaptor/RRFRaptor.sh ;;

12)
/etc/spotnik/view_svx ;;

13)
spot_config ;;

esac

done
exit 0
