Advertisement
NilsRapilly

access.sh

Sep 5th, 2019
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.74 KB | None | 0 0
  1. #!/bin/bash
  2. #__ Color headers
  3. RED='\033[1;31m'
  4. BLUE='\033[1;34m'
  5. YELLOW='\033[1;33m'
  6. PURPLE='\033[1;35m'
  7. WHITE='\033[1;37m'
  8. GREY='\033[1;30m]'
  9. NC='\033[0m'
  10.  
  11. #___________________//
  12. #____ BANNER_______//
  13. function banner(){
  14.       clear
  15.           echo -e " ${BLUE}
  16.              █████╗  ██████╗ ██████╗███████╗███████╗███████╗
  17.             ██╔══██╗██╔════╝██╔════╝██╔════╝██╔════╝██╔════╝
  18.             ███████║██║     ██║     █████╗  ███████╗███████╗
  19.             ██╔══██║██║     ██║     ██╔══╝  ╚════██║╚════██║
  20.             ██║  ██║╚██████╗╚██████╗███████╗███████║███████║
  21.             ╚═╝  ╚═╝ ╚═════╝ ╚═════╝╚══════╝╚══════╝╚══════╝${NC}
  22. "
  23. sleep 0.5
  24. }
  25. #___________________
  26. clear
  27. #___________________//
  28. #____ FUNCTIONS ___//
  29.  
  30.  
  31.  
  32.  
  33.  
  34. #________________________________________________//
  35. #____PROGRAM____________________________________//
  36.  
  37. #fetching env variables
  38. banner
  39. id=$(echo $UID)
  40. current_user=$(whoami)
  41.  
  42. #testing current user
  43. case "$id" in
  44. 0)
  45.     echo -e "   ${YELLOW}> > > ${RED}root ${NC} user confirmed"
  46.     read -p '   name of your file (without .ovpn) : ' namefile
  47.     openvpn $namefile.ovpn & disown
  48.  
  49.     ;;
  50. *)
  51.     echo -e "   ${YELLOW}> > > ${NC} please run script as root ${RED} $current_user ${NC}"
  52.     ;;
  53. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement