Fixing a text and some wakeup case for wifi. - conn - A script repository to manage connections in Linux.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 64a4feff7be263c63d7ca438cdef725625788c64
(DIR) parent 3d6eac71e9f706e792fabad36df4005ed7523367
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Sun, 19 Jun 2011 10:29:07 +0200
Fixing a text and some wakeup case for wifi.
Diffstat:
etc/conn/common.sh | 9 +++++----
etc/conn/run.sh | 11 +++++++++--
2 files changed, 14 insertions(+), 6 deletions(-)
---
(DIR) diff --git a/etc/conn/common.sh b/etc/conn/common.sh
@@ -103,12 +103,13 @@ getdefaultstate() {
}
## WPA handling
-WPAPID="${RUNDIR}/wpa_supplicant.pid"
-WPACLIPID="${RUNDIR}/wpa_cli.pid"
startwpa() {
- $WPACMD -i $1
- $WPACLICMD -i $1 -a $WIFIDIR/$1-action.sh 2>&1 >/dev/null &
+ PID=`pgrep -f "$WPACMD -i $1"`
+ [ -z "$PID" ] && $WPACMD -i $1
+ PID=`pgrep -f "$WPACLICMD -i $1 $WIFIDIR/$1-action.sh"`
+ [ -z "$PID" ] && $WPACLICMD -i $1 -a $WIFIDIR/$1-action.sh \
+ 2>&1 >/dev/null &
}
hupwpa() {
(DIR) diff --git a/etc/conn/run.sh b/etc/conn/run.sh
@@ -89,10 +89,17 @@ then
exit 0
fi
-t[ $dowakeup -eq 1 ] && cmdarg="-f -s"
+if [ $dowakeup -eq 1 ];
+tthen
+ [ $LOGGING -eq 1 ] && \
+ logger -s -t "conn" "waking up"
+ cmdarg="-f -s"
+fi
if [ $dosuspend -eq 1 ];
tthen
+ [ $LOGGING -eq 1 ] && \
+ logger -s -t "conn" "suspending"
$0 -f -k $*
exit 0
fi
@@ -144,7 +151,7 @@ then
if isset "open" $connection $profile;
then
echo "Connection $connection $profile is already open."
- echo "Use -f for forcing the closing."
+ echo "Use -f for forcing the opening."
exit 1
fi
fi