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
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"
}