From 830136bec43c45d49d2cc501be25d70b3dcb0b91 Mon Sep 17 00:00:00 2001 From: fbt Date: Sat, 5 Apr 2014 11:52:51 +0400 Subject: [PATCH] We have an admin port that is not random --- init.d/cjdroute | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/init.d/cjdroute b/init.d/cjdroute index a9cdab4..3659121 100755 --- a/init.d/cjdroute +++ b/init.d/cjdroute @@ -3,11 +3,10 @@ unset reload service_command='/usr/bin/cjdroute' + cjdroute_config='/etc/cjdroute.conf' -source "${cfg_dir}/conf.d/cjdroute.sh" - -service_pid=`lsof -i :"$cjdroute_listen_port" | tail -1 | cut -d ' ' -f 2` +cjdroute_admin_port='11234' cjdroute.check_tun_module() { [[ -e '/dev/net/tun' ]] || { @@ -18,6 +17,10 @@ cjdroute.check_tun_module() { } } +get_pid() { + lsof -i :"$cjdroute_admin_port" | tail -1 | cut -d ' ' -f 2 +} + start() { cjdroute.check_tun_module || { return 1; } @@ -26,5 +29,5 @@ start() { return 1 } - "$service_command" < "$cjdroute_config" + "$service_command" < "$cjdroute_config" &>"$service_logfile" }