[sr-dev] git:master: kamctl: check if kamctlrc is in the same folder
Daniel-Constantin Mierla
miconda at gmail.com
Sun Oct 5 22:51:23 CEST 2014
Module: sip-router
Branch: master
Commit: aba6ee05e525a66a9e7168336c76d069a1dccc24
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=aba6ee05e525a66a9e7168336c76d069a1dccc24
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: Sun Oct 5 10:07:34 2014 +0200
kamctl: check if kamctlrc is in the same folder
---
utils/kamctl/kamctl | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index 1f35ea5..2f1e03a 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -1,7 +1,5 @@
#!/bin/bash
#
-# $Id$
-#
# control tool for maintaining Kamailio
#
#===================================================================
@@ -16,6 +14,16 @@ PATH=$PATH:/usr/local/sbin/
TEST="false"
### include config files
+
+which readlink > /dev/null
+ret=$?
+if [ $ret -eq 0 ] ; then
+ KAMCTLFULLPATH=$(readlink -f "$0")
+ KAMCTLDIRPATH=$(dirname "$KAMCTLFULLPATH")
+ if [ -f $KAMCTLDIRPATH/kamctlrc ]; then
+ . $KAMCTLDIRPATH/kamctlrc
+ fi
+fi
if [ -f /etc/kamailio/kamctlrc ]; then
. /etc/kamailio/kamctlrc
fi
More information about the sr-dev
mailing list