morpheus-base

morpheus base system
git clone git://git.2f30.org/morpheus-base.git
Log | Files | Refs

simevent (307B)


      1 #!/bin/sh
      2 #
      3 # Simulate add/remove events by writing directly
      4 # into the uevent files.
      5 
      6 if [ -z $1 ]; then
      7 	echo "usage: $(basename $0) add|remove" 2>&1
      8 	exit 1
      9 fi
     10 
     11 ev=$1
     12 for i in $(find /sys/devices -type f); do
     13 	f=$(basename $i)
     14 	if [ "$f" = "dev" ]; then
     15 		d=$(dirname $i)
     16 		echo $ev > $d/uevent
     17 	fi
     18 done