Package: sysfsutils
Version: 1.2.0-1
The init script for sysfsutils isn't so hot. Please consider the
attached patch.
--
Jamie Heilman http://audible.transient.net/~jamie/
"...thats the metaphorical equivalent of flopping your wedding tackle
into a lion's mouth and flicking his lovespuds with a wet towel, pure
insanity..." -Rimmer
--- ./sysfsutils.bash 2005-01-17 00:54:46.000000000 -0800
+++ ./sysfsutils 2005-01-18 01:24:36.000000000 -0800
@@ -13,20 +13,12 @@
start|restart|force-reload)
echo -n "Setting sysfs variables..."
- sed -e 's/#.*$//' -e '/^[[:space:]]*$/d' /etc/sysfs.conf | (
- while read line; do
- key=${line%=*}
- key=${key//./\/}
- key=${key// /}
- val=${line#*=}
-
- if [ -f $MNTPATH/$key ]; then
- echo $val > $MNTPATH/$key
- else
- echo "unknown attribute $key"
- fi
- done
- )
+ awk -v S="$MNTPATH" '
+ BEGIN { FS="[ \t]*=[ \t]*" }
+ $0 ~ /^[ \t]*(#|$)/ { next }
+ system("test -f "S"/"$1) == 0 { print $2 > S"/"$1; next }
+ { print "unknown attribute "$1 }
+ ' "$CONFFILE"
echo "done."
;;