You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
439 B

  1. #!/bin/bash
  2. listandReturn() {
  3. printf "Listing contents of %s.\\n" "$1"
  4. ls -rc "$1" | awk -F '/' '{print $NF}' | nl
  5. read -erp "Pick an entry by number to $2, or press ctrl-c to cancel. " number
  6. chosen="$(ls -rc "$1" | nl | grep -w "$number" | awk '{print $2}')"
  7. basefile="$(basename "$chosen")" && base="${basefile%.*}"
  8. }
  9. listandReturn ~/.openvpn/UDP\ 1194\ Normal/
  10. sudo openvpn --config ~/.openvpn/UDP\ 1194\ Normal/${basefile}