Hi,

last patch for "sudo functionality in t_client.sh" was incomplete, and
for some reason I didn't notice on the test system - fell on my feet on
the freebsd 7.4 test client, and is now fixed for good :-)

gert

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             g...@greenie.muc.de
fax: +49-89-35655025                        g...@net.informatik.tu-muenchen.de
From 7557b960593aa7240cfe7f9e9b5628e3b4ef55c9 Mon Sep 17 00:00:00 2001
From: Gert Doering <g...@greenie.muc.de>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Fri, 3 Feb 2012 19:18:07 +0200
Subject: [PATCH] Fix RUN_SUDO functionality for t_client.sh

Commit 9c6ee9d1ecd85535c was incomplete - while it will run openvpn with
sudo, it will not use sudo for the "kill" commands needed to test whether
the background process is still there, and for actually stopping openvpn
after the test has finished.

Signed-off-by: Gert Doering <g...@greenie.muc.de>
---
 t_client.sh.in |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/t_client.sh.in b/t_client.sh.in
index a6377db..47839de 100755
--- a/t_client.sh.in
+++ b/t_client.sh.in
@@ -233,14 +233,14 @@ do
     opid=$!
 
     # make sure openvpn client is terminated in case shell exits
-    trap "kill $opid" 0
-    trap "kill $opid ; trap - 0 ; exit 1" 1 2 3 15
+    trap "$RUN_SUDO kill $opid" 0
+    trap "$RUN_SUDO kill $opid ; trap - 0 ; exit 1" 1 2 3 15
 
     echo "wait for connection to establish..."
     sleep 10
 
     # test whether OpenVPN process is still there
-    if kill -0 $opid
+    if $RUN_SUDO kill -0 $opid
     then :
     else
        echo -e "OpenVPN process has failed to start up, check log 
($LOGDIR/$SUF:openvpn.log).  FAIL.\ntail of logfile follows:\n..." >&2
@@ -271,7 +271,7 @@ do
     echo -e "ping tests done.\n"
 
     echo "stopping OpenVPN"
-    kill $opid
+    $RUN_SUDO kill $opid
     wait $!
     rc=$?
     if [ $rc != 0 ] ; then
-- 
1.7.3.5

Attachment: pgpx7Q9S02fHz.pgp
Description: PGP signature

Reply via email to