aboutsummaryrefslogtreecommitdiff
path: root/config/i3blocks/scripts/iface
blob: 17e07d6ffdcd86b10f1cb2e3f46d7233be2dc961 (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

table=$(ip route get 1)
if [ $? -ne 0 ]; then
	echo "Offline"
	exit 0
fi

ip=$(echo $table | sed -n 's/.*src \([0-9.]\+\).*/\1/p')
echo $ip