tmux-kanagawa/scripts/network_vpn.sh
Tomás Migone 0850532083 feat: add network-vpn plugin (only macOS)
Signed-off-by: Tomás Migone <tomasmigone@gmail.com>
2022-08-26 10:57:46 +02:00

32 lines
567 B
Bash
Executable file

#!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source $current_dir/utils.sh
vpn_function() {
case $(uname -s) in
Linux | Darwin)
vpn=$(scutil --nc list | grep Connected)
if [ -z $vpn ]; then
echo ""
else
echo "VPN"
fi
;;
CYGWIN* | MINGW32* | MSYS* | MINGW*)
# TODO - windows compatability
;;
esac
}
main() {
echo $(vpn_function)
}
# run main driver
main