this works, but im sure im doing this wrong
#!/bin/bash
# VPN current status
# no vpn, home vpn, work vpn
#check home
if ifconfig | grep -q tun0; then
home=1
else
home=0
fi
#check work
if ifconfig | grep -q ppp0; then
work=2
else
work=0
fi
#add checks to var status
let status=home+work
if [ $status = 0 ]; then
output=N
fi
if [ $status = 1 ]; then
output=H
fi
if [ $status = 2 ]; then
output=W
fi
if [ $status = 3 ]; then
output=HW
fi
echo $output
exit