first commit

This commit is contained in:
encrypt 2015-03-23 01:36:38 +01:00
commit c063a703e4
2 changed files with 27 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*~

26
etherswitch.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/env bash
STATE=0
source ~/.etherswitch
while :
do
ip link show $interface | grep -q "LOWER_UP"
if [ $? -eq 1 ]
then
if [ $STATE -eq 1 ]
then
STATE=0
echo "not connected"
fi
else
if [ $STATE -eq 0 ]
then
STATE=1
echo "connected"
fi
fi
sleep 0.3
done