Advertisement
dimmuboy

OpenVPN

Mar 17th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. MYDIR="$HOME/.config/openvpn/"
  4.  
  5. DIRS=`ls -l $MYDIR | egrep '^d' | awk '{print $9}'`
  6. for DIR in $DIRS
  7. do
  8.     RADIOLIST=$RADIOLIST" $DIR $DIR"
  9. done
  10.  
  11. pocet=`echo $DIRS | wc -w`
  12. #whiptail --title "Test Menu Dialog" --menu "Choose your option" 40 60 30 ${RADIOLIST}
  13.  
  14. vyska=`tput lines`
  15. let "vyska -= 5"
  16.  
  17. 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)
  18.  
  19. exitstatus=$?
  20. if [ $exitstatus = 0 ]; then
  21.     echo "Your chosen option:" $OPTION
  22.     cesta=$MYDIR$OPTION
  23.     echo $cesta
  24.     cd $cesta
  25.     sudo openvpn *.ovpn
  26. else
  27.   clear
  28. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement