We have an admin port that is not random

This commit is contained in:
Jack L. Frost 2014-04-05 11:52:51 +04:00
parent a8d70c2343
commit 830136bec4

View File

@ -3,11 +3,10 @@
unset reload unset reload
service_command='/usr/bin/cjdroute' service_command='/usr/bin/cjdroute'
cjdroute_config='/etc/cjdroute.conf' cjdroute_config='/etc/cjdroute.conf'
source "${cfg_dir}/conf.d/cjdroute.sh" cjdroute_admin_port='11234'
service_pid=`lsof -i :"$cjdroute_listen_port" | tail -1 | cut -d ' ' -f 2`
cjdroute.check_tun_module() { cjdroute.check_tun_module() {
[[ -e '/dev/net/tun' ]] || { [[ -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() { start() {
cjdroute.check_tun_module || { return 1; } cjdroute.check_tun_module || { return 1; }
@ -26,5 +29,5 @@ start() {
return 1 return 1
} }
"$service_command" < "$cjdroute_config" "$service_command" < "$cjdroute_config" &>"$service_logfile"
} }