blob: d443091caa2fb8007678aa54e96dafbf3220adb0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
PIDFILE=/tmp/statNet.pid
STATUSFILE=/tmp/dsbANet
kill `cat $PIDFILE`
if [ $? -eq 0 ]; then
echo "Shutting down"
rm $STATUSFILE
exit
fi
echo $$ > $PIDFILE
while true; do
IP=$( ip -4 a | grep "inet " | sed "s:inet \(.*\)/.*:\1:" | tr -d " " | grep -v "0.1" | tr "\n" " ")
echo "$IP " > $STATUSFILE
sleep 10
done
|