Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- MYDIR="$HOME/.config/openvpn/"
- DIRS=`ls -l $MYDIR | egrep '^d' | awk '{print $9}'`
- for DIR in $DIRS
- do
- RADIOLIST=$RADIOLIST" $DIR $DIR"
- done
- pocet=`echo $DIRS | wc -w`
- #whiptail --title "Test Menu Dialog" --menu "Choose your option" 40 60 30 ${RADIOLIST}
- vyska=`tput lines`
- let "vyska -= 5"
- OPTION=$(dialog --clear --backtitle "OpenVPN Manager" --title "OpenVPN List" --cancel-label "Exit" --menu "Select one:" $vyska 60 $vyska ${RADIOLIST} 3>&1 1>&2 2>&3)
- exitstatus=$?
- if [ $exitstatus = 0 ]; then
- echo "Your chosen option:" $OPTION
- cesta=$MYDIR$OPTION
- echo $cesta
- cd $cesta
- sudo openvpn *.ovpn
- else
- clear
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement