1 #!/bin/sh
2 if [ -a /sys/devices/platform/omap/ti81xx-usbss/musb-hdrc.0/gadget/lun0/file ]
3 then
4 x=$(cat /sys/devices/platform/omap/ti81xx-usbss/musb-hdrc.0/gadget/lun0/file)
5 if [ -z "$x" ]
6 then
7 /bin/systemctl stop storage-gadget-init.service
8 /bin/systemctl start network-gadget-init.service
9 /bin/systemctl start udhcpd.service
10 fi
11 fi