0850532083
Signed-off-by: Tomás Migone <tomasmigone@gmail.com>
32 lines
567 B
Bash
Executable file
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
|