summaryrefslogtreecommitdiffstats
path: root/.local/bin/status/sb-net
blob: 50fdc0aa5293e8a7a4e2c0e2485ffee945057f98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

echo -n "^c#a89984^"
case $(hostname -s) in
	mother|po-rbo) ping="ping -c1 -w1 9.9.9.9" ;;
	mars)          ping="ping -c1 -t1 9.9.9.9" ;;
esac
ifc=$(ifconfig)
if echo "$ifc" | grep -E '^wg' >/dev/null 2>&1; then
	echo -n "󰞀  "
fi
if echo "${ifc}" | grep -E '^zt' >/dev/null 2>&1; then
	echo -n "  "
fi
if echo "${ifc}" | grep -E '^tun|^vpn' >/dev/null 2>&1; then
	echo -n "󰖂  "
fi
if ! $ping >/dev/null 2>&1; then
	echo "󰲜"
	exit
fi

echo "󰲝"