aboutsummaryrefslogtreecommitdiff
path: root/utils/usbmuxd/files/usbmuxd.hotplug
diff options
context:
space:
mode:
Diffstat (limited to 'utils/usbmuxd/files/usbmuxd.hotplug')
-rw-r--r--utils/usbmuxd/files/usbmuxd.hotplug24
1 files changed, 24 insertions, 0 deletions
diff --git a/utils/usbmuxd/files/usbmuxd.hotplug b/utils/usbmuxd/files/usbmuxd.hotplug
new file mode 100644
index 000000000..84986cc96
--- /dev/null
+++ b/utils/usbmuxd/files/usbmuxd.hotplug
@@ -0,0 +1,24 @@
+case "$ACTION" in
+ bind)
+ dev=/sys$DEVPATH
+
+ [ ! -f /tmp/iPhone.lock ] && [ -d ${dev}/net ] &&
+ {
+ readlink ${dev}/driver | grep -q ipheth &&
+ {
+ sleep 5
+ carrier_path=${dev}/net/*/carrier
+ carrier=`cat ${carrier_path}`
+
+ [ "${carrier}" = "0" ] &&
+ {
+ touch /tmp/iPhone.lock
+ logger -p daemon.error -t iPhone ${carrier_path} = ${carrier}
+ logger -p daemon.error -t iPhone `/usr/bin/usbreset iPhone`
+ /etc/init.d/usbmuxd restart
+ sleep 5 && rm -f /tmp/iPhone.lock &
+ }
+ }
+ }
+ ;;
+esac