#!/bin/sh ### BEGIN INIT INFO # Provides: inotify # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start inotif # Description: Start inotif ### END INIT INFO case $1 in start) while true do RES=`inotifywait -q -e CREATE,DELETE /dev/input/` case "$RES" in "/dev/input/ DELETE event1") ifconfig wlan0 up ;; "/dev/input/ CREATE event1") ifconfig wlan0 down ;; esac done & ;; esac