do
kill -19 $PID #send SIGSTOP
done
- rm /tmp/hcistate
+ test -f /tmp/hcistate && rm /tmp/hcistate
hcistate=$(hciconfig hci0 | grep DOWN)
if [ $hcistate ]; then
echo "down" > /tmp/hcistate
else
hciconfig hci0 down
fi
- rm /tmp/wlstate
+ test -f /tmp/wlstate && rm /tmp/wlstate
wlstate=$(lsmod | grep -m1 wl1251)
- if [ ! $wlstate ]; then
+ if [ -z "$wlstate" ]; then
echo "down" > /tmp/wlstate
else
ifconfig wlan0 down
hciconfig hci0 up pscan
fi
wlstate=$(cat /tmp/wlstate)
- if [ ! $wlstate ]; then
+ if [ -z "$wlstate" ]; then
/etc/init.d/wl1251-init start
fi
pidlist=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p')