]> code.delx.au - spectrwm/commitdiff
kill iostat when restarting scrotwm
authorMarco Peereboom <marco@conformal.com>
Sun, 13 Sep 2009 21:37:39 +0000 (21:37 +0000)
committerMarco Peereboom <marco@conformal.com>
Sun, 13 Sep 2009 21:37:39 +0000 (21:37 +0000)
from Joe Gidi <joe@entropicblur.com>

baraction.sh

index 03c32d21f5bae481ba4f217c03a2ef843f93e95a..d8d519c3b393557a236af81607220042fa184c72 100644 (file)
@@ -78,8 +78,10 @@ while :; do
        # instead of sleeping, use iostat as the update timer.
        # cache the output of apm(8), no need to call that every second.
        /usr/sbin/iostat -C -c 3600 |&  # wish infinity was an option
+       PID="$!"
        APM_DATA=""
        I=0
+       trap "kill $PID; exit" TERM
        while read -p; do
                if [ $(( ${I} % 1 )) -eq 0 ]; then
                        APM_DATA=`/usr/sbin/apm -alb`