From 89b034b6767f80c13410bd49bf5beeb8549dd888 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Wed, 23 Aug 2006 20:58:10 +0000 Subject: [PATCH] - Search "fail2ban-server" using PATH and if it fails, use the current directory git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@305 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- fail2ban-client | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fail2ban-client b/fail2ban-client index 6b9b3fd2..0e7f159b 100755 --- a/fail2ban-client +++ b/fail2ban-client @@ -194,7 +194,16 @@ class Fail2banClient: pid = os.fork() if pid == 0: - os.execv("fail2ban-server", args) + try: + # Use the PATH env + os.execvp("fail2ban-server", args) + except OSError: + try: + # Use the current directory + os.execv("fail2ban-server", args) + except OSError: + print "Could not find fail2ban-server" + os.exit(-1) def waitOnServer(self):