[pisa-src] r1209 - in trunk/tools: auto-handover-tablet.sh auto-handover.sh

Author: biurrun
Date: Thu Oct 15 22:46:59 2009
New Revision: 1209

Log:
POSIX shell compatibility fixes

Modified:
   trunk/tools/auto-handover-tablet.sh
   trunk/tools/auto-handover.sh

Modified: trunk/tools/auto-handover-tablet.sh
==============================================================================
--- trunk/tools/auto-handover-tablet.sh Thu Oct 15 22:44:00 2009        (r1208)
+++ trunk/tools/auto-handover-tablet.sh Thu Oct 15 22:46:59 2009        (r1209)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 echo "This file searches APs with SSID $PATTERN* and switches to the strongest 
signal"
 
@@ -27,16 +27,16 @@
 
 
 fail_counter=0
-while [ 1 ]; do
+while true; do
 
 result=($(iwlist $WIFI_IF scanning | ./iwlist_parser -s $PATTERN))
 
-if [ "${result[0]}" == "NONE" ]; then
+if [ "${result[0]}" = "NONE" ]; then
         echo "No PISA access points nearby"
         fail_counter=$(($fail_counter+1))
         echo "Increasing module fail counter $fail_counter"
         last_result=${result[0]}
-        if [ "$fail_counter" == "5" ]; then
+        if [ "$fail_counter" = "5" ]; then
                 echo "Restarting kernel modules"
                 rmmod ath9k
                 modprobe ath9k

Modified: trunk/tools/auto-handover.sh
==============================================================================
--- trunk/tools/auto-handover.sh        Thu Oct 15 22:44:00 2009        (r1208)
+++ trunk/tools/auto-handover.sh        Thu Oct 15 22:46:59 2009        (r1209)
@@ -14,10 +14,10 @@
 ## internal parameters
 last_result="NONE"
 
-while [ 1 ]; do
+while true; do
     result=($(iwlist $WIFI_IF scan | ./iwlist_parser -s $PATTERN))
 
-    if [ "${result[0]}" == "NONE" ]; then
+    if [ "${result[0]}" = "NONE" ]; then
         echo "No PISA access points nearby"
     elif [ "$last_result" != "${result[0]}" ]; then
         echo "Changing to " ${result[1]}

Other related posts:

  • » [pisa-src] r1209 - in trunk/tools: auto-handover-tablet.sh auto-handover.sh - Diego Biurrun