mirror of
https://github.com/lloeki/toolbelt.git
synced 2025-12-06 01:54:41 +01:00
cruft
This commit is contained in:
parent
7887c1a98c
commit
aa2a1bd203
1 changed files with 0 additions and 38 deletions
|
|
@ -1,38 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
[ "$UID" == 0 ] || exec sudo $0
|
|
||||||
|
|
||||||
TARGET='10.0.100.254'
|
|
||||||
TIMEOUT='5'
|
|
||||||
|
|
||||||
kext='/System/Library/Extensions/BCM5722D.kext'
|
|
||||||
|
|
||||||
std_date() {
|
|
||||||
echo -n $(date +'%Y-%m-%d %H:%M:%S')
|
|
||||||
}
|
|
||||||
|
|
||||||
is_up() {
|
|
||||||
ping -q -t $TIMEOUT -o -r $TARGET > /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
wait_for_up() {
|
|
||||||
ping -q -o -r $TARGET > /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
restart_iface() {
|
|
||||||
echo "syncing"
|
|
||||||
sync
|
|
||||||
echo "unloading kext"
|
|
||||||
kextunload $kext
|
|
||||||
echo "loading kext"
|
|
||||||
kextload $kext
|
|
||||||
}
|
|
||||||
|
|
||||||
while wait_for_up; do
|
|
||||||
while is_up; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "en0 down @ `std_date`"
|
|
||||||
restart_iface
|
|
||||||
done
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue