[PATCH 1/1] Fix current log dir symbolic link

Eduardo Abinader eduardo.abinader
Mon Feb 24 07:46:53 PST 2014


This patch aims to fix the update of current symbolic link,
when LOGDIR is already set. The current symbolic link was only
set, if LOGDIR has not been previously defined. If the user
had chosen to cancel the running test and run it again, the current
symbolic link was not being updated.

Signed-off-by: Eduardo Abinader <eduardo.abinader at openbossa.org>
---
 tests/hwsim/start.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh
index f5e8f27..3bd6f02 100755
--- a/tests/hwsim/start.sh
+++ b/tests/hwsim/start.sh
@@ -7,13 +7,11 @@ HAPD=$DIR/../../hostapd/hostapd
 HAPD_AS=$DIR/../../hostapd/hostapd
 WLANTEST=$DIR/../../wlantest/wlantest
 HLR_AUC_GW=$DIR/../../hostapd/hlr_auc_gw
+DATE="$(date +%s)"
 
 if [ -z "$LOGDIR" ] ; then
-    DATE="$(date +%s)"
     LOGDIR="$DIR/logs/$DATE"
     mkdir -p $LOGDIR
-    rm -rf $DIR/logs/current
-    ln -sf $DATE $DIR/logs/current
 else
     if [ -e $LOGDIR/alt-wpa_supplicant/wpa_supplicant/wpa_supplicant ]; then
 	WPAS=$LOGDIR/alt-wpa_supplicant/wpa_supplicant/wpa_supplicant
@@ -29,6 +27,9 @@ else
     fi
 fi
 
+rm -rf $DIR/logs/current
+ln -sf $DATE $DIR/logs/current
+
 if groups | tr ' ' "\n" | grep -q ^admin$; then
     GROUP=admin
 else
-- 
1.8.1.2




More information about the Hostap mailing list