smdev

suckless mdev
git clone git://git.2f30.org/smdev.git
Log | Files | Refs | README | LICENSE

commit a87487aa9b81f96fa25c612354c55321aead165a
parent a20b96408a4ca0bfe59855558404d0946e3a39a1
Author: sin <sin@2f30.org>
Date:   Sun Sep 28 13:17:53 +0100

Add bin/

Diffstat:
bin/simevent | 18++++++++++++++++++
simevent | 18------------------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/bin/simevent b/bin/simevent @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Simulate add/remove events by writing directly +# into the uevent files. + +if [ -z $1 ]; then + echo "usage: $(basename $0) add|remove" 2>&1 + exit 1 +fi + +ev=$1 +for i in $(find /sys/devices -type f); do + f=$(basename $i) + if [ "$f" = "dev" ]; then + d=$(dirname $i) + echo $ev > $d/uevent + fi +done diff --git a/simevent b/simevent @@ -1,18 +0,0 @@ -#!/bin/sh -# -# Simulate add/remove events by writing directly -# into the uevent files. - -if [ -z $1 ]; then - echo "usage: $(basename $0) add|remove" 2>&1 - exit 1 -fi - -ev=$1 -for i in $(find /sys/devices -type f); do - f=$(basename $i) - if [ "$f" = "dev" ]; then - d=$(dirname $i) - echo $ev > $d/uevent - fi -done