From 0decb5f91810b0eabf857813b2a6ce5857639ceb Mon Sep 17 00:00:00 2001 From: Michael Mrozek Date: Sat, 12 Nov 2011 02:33:43 +0100 Subject: [PATCH] op_power.sh: Tested if file exists before rm to prevent error messages --- recipes/pandora-system/pandora-scripts/op_power.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/pandora-system/pandora-scripts/op_power.sh b/recipes/pandora-system/pandora-scripts/op_power.sh index 552ac0c..b2acf74 100644 --- a/recipes/pandora-system/pandora-scripts/op_power.sh +++ b/recipes/pandora-system/pandora-scripts/op_power.sh @@ -26,16 +26,16 @@ lowPowerOn(){ #switch from normal to lowpower mode 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 @@ -65,7 +65,7 @@ lowPowerOff(){ # switch from lowpower to normal mode 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') -- 2.39.5