~hokiegeek/bin

f3fd222754b7cce9998ad5e8201ded135ca18c5b — HokieGeek 4 months ago 939801a main
[bwvpn] using sed instead of awk
1 files changed, 1 insertions(+), 1 deletions(-)

M bwvpn
M bwvpn => bwvpn +1 -1
@@ 9,7 9,7 @@ if [[ "$cmd" == "stop" ]]; then
        openvpn3 session-manage --disconnect --path $p
    done
elif [[ "$cmd" == "start" ]]; then
    bwsession=$(bw unlock | awk -F= '$1 ~ /export BW_SESSION/ { gsub(/"/, "", $2); print $2 }')
    bwsession=$(bw unlock | sed -nE '/ export BW_SESSION=/s/^.*"([^"]+)".*$/\1/p')
    [ -z "${bwsession}" ] && exit 1
    expect <<-EOF
    spawn openvpn3 session-start --config ${vpncfg}