ssm-services/init.d/cjdroute
2014-02-25 04:45:13 +04:00

26 lines
501 B
Plaintext
Executable File

#!/usr/bin/env watchman
unset reload
service_command='/usr/local/sbin/cjdroute'
cjdroute_config='/etc/cjdroute.conf'
cjdroute_tun_interface='cjdns0'
cjdroute_listen_port='7530'
service_pid=`lsof -i :"$cjdroute_listen_port" | tail -1 | cut -d ' ' -f 2`
cjdroute.check_tun_module() {
[[ -e '/dev/net/tun' ]] || {
modprobe tun || {
watchman.err "Could not load module tun!"
return 1
}
}
}
start() {
cjdroute.check_tun_module || { return 1; }
"$service_command" < "$cjdroute_config"
}