Skip to content

Commit

Permalink
Merge pull request #270 from muX1337/patch-1
Browse files Browse the repository at this point in the history
Update network_vpn.sh linux
  • Loading branch information
ethancedwards8 authored Aug 18, 2024
2 parents b59db11 + 575b327 commit 5626c88
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/network_vpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ source $current_dir/utils.sh
vpn_function() {
case $(uname -s) in
Linux)
# TODO
#Show IP of tun0 if connected
vpn=$(ip -o -4 addr show dev tun0 | awk '{print $4}' | cut -d/ -f1)

if [[ $vpn =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
echo $vpn
else
echo "NO VPN"
fi
;;

Darwin)
Expand Down

0 comments on commit 5626c88

Please sign in to comment.