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

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