From 616ae7b9fb06b442f6d401cacc181e28cb928adb Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 1 Jan 2016 14:20:53 +0000 Subject: [PATCH] Updates and changes to ip_relay to look for installed package and to relay_control git-svn-id: svn://192.168.202.10@2452 3d104415-ff17-0410-8863-d5cf3c621b8a --- extras/ip_relay/relay_control | 22 +++++++++++++++------- install.pl | 6 ++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/extras/ip_relay/relay_control b/extras/ip_relay/relay_control index 66b91ab0..2455d7e0 100644 --- a/extras/ip_relay/relay_control +++ b/extras/ip_relay/relay_control @@ -2,9 +2,9 @@ # # relay_control ip_relay startup/shutdown script # -# Version: 1.0 ip_relay/relay_control 7-Feb-2003 +# Version: 1.1 ip_relay/relay_control started: 2003-02-07 modified: 2016-01-01 # -# info@eflo.net +# vicidial@gmail.com # # This script is released under the BSD license # (for compatibility with the ip_relay project) @@ -14,17 +14,23 @@ # # Changes: # 140619-0954 - Added new port 42569 for playback loops +# 160101-0912 - Added check for installed ip_relay binary # +IPRELAY_BIN="/usr/bin/ip_relay" + +if [ ! -x $IPRELAY_BIN ]; then + IPRELAY_BIN="/usr/local/bin/ip_relay" +fi case "$1" in start) - echo "starting up ip_relay services " + echo "starting up ip_relay services at $IPRELAY_BIN" - ip_relay 40569 127.0.0.1 4569 9999999 & - ip_relay 41569 127.0.0.1 4569 9999999 & - ip_relay 42569 127.0.0.1 4569 9999999 & + $IPRELAY_BIN 40569 127.0.0.1 4569 9999999 & + $IPRELAY_BIN 41569 127.0.0.1 4569 9999999 & + $IPRELAY_BIN 42569 127.0.0.1 4569 9999999 & echo "done " echo @@ -49,7 +55,9 @@ case "$1" in echo "Shutting down ip_relay services " # Turn off IP Forwarding - kill `ps -C ip_relay -o pid --no-heading` + echo "Running: kill -9 `ps -C ip_relay -o pid --no-heading`" + + kill -9 `ps -C ip_relay -o pid --no-heading` echo "Done " diff --git a/install.pl b/install.pl index bb6ba059..7bfb0c9f 100644 --- a/install.pl +++ b/install.pl @@ -2,7 +2,7 @@ # install.pl version 2.12 # -# Copyright (C) 2015 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 # # CHANGES @@ -41,6 +41,7 @@ # 150911-1808 - Added creation of GPG directory for encrypted recordings # 151029-0650 - Added Asterisk 11 as listed option, added new sample voicemail.conf for 1.8 and higher # 151212-0840 - Added chat_customer web directory, removed static language build actions +# 160101-0907 - Changed ip_relay code to look for installed package # ############################################ @@ -2543,8 +2544,9 @@ if ($WEBONLY < 1) `chmod 0755 $PATHhome/ip_relay/relay_control`; `chmod 0755 $PATHhome/ip_relay/ip_relay_linux_i386`; `ln -s $PATHhome/ip_relay/ip_relay_linux_i386 $PATHhome/ip_relay/ip_relay`; - `ln -s $PATHhome/ip_relay/ip_relay_linux_i386 /usr/bin/ip_relay`; `ln -s $PATHhome/ip_relay/ip_relay_linux_i386 /usr/local/bin/ip_relay`; + if (! -x "/usr/bin/ip_relay" ) + {`ln -s $PATHhome/ip_relay/ip_relay_linux_i386 /usr/bin/ip_relay`;} print "Starting ip_relay port forwarding for IAX on 40569, 41569 and 42569\n"; `$PATHhome/ip_relay/relay_control start 2>/dev/null 1>&2`;