From e8d41479978b9b90beee7fd8b2405dda414d7c57 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Wed, 27 Apr 2011 16:48:37 +0000 Subject: [PATCH] Fix restart to work if mediaproxy didn't run before. --- debian/ngcp-mediaproxy-ng-daemon.init | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/ngcp-mediaproxy-ng-daemon.init b/debian/ngcp-mediaproxy-ng-daemon.init index 8a1554474..6a23fbea9 100755 --- a/debian/ngcp-mediaproxy-ng-daemon.init +++ b/debian/ngcp-mediaproxy-ng-daemon.init @@ -95,8 +95,14 @@ case "$1" in rm -f $PIDFILE sleep 1 set +e - echo "del $TABLE" > /proc/mediaproxy/control 2>/dev/null + if [ -e /proc/mediaproxy/control ]; then + echo "del $TABLE" > /proc/mediaproxy/control 2>/dev/null + fi + iptables -D INPUT -j MEDIAPROXY --id $TABLE 2>/dev/null + rmmod ipt_MEDIAPROXY 2>/dev/null set -e + modprobe ipt_MEDIAPROXY + iptables -I INPUT -j MEDIAPROXY --id $TABLE start-stop-daemon --start --quiet --pidfile \ $PIDFILE --exec $DAEMON -- $OPTIONS log_end_msg $?