cjdroute pid detection
This commit is contained in:
parent
8e5f179a9e
commit
fdb9b0de95
|
@ -1,15 +1,15 @@
|
||||||
#!/usr/bin/env watchman
|
#!/usr/bin/env watchman
|
||||||
# An example cjdroute init script with a custom interface
|
|
||||||
|
|
||||||
unset reload
|
unset reload
|
||||||
|
|
||||||
service_username='cjdroute'
|
service_username='cjdns'
|
||||||
service_command='/home/cjdroute/cjdns/cjdroute'
|
service_command='/home/cjdns/cjdns/cjdroute'
|
||||||
service_args='< /home/cjdroute/cjdns/cjdroute.conf'
|
service_args='< /home/cjdns/cjdns/cjdroute.conf'
|
||||||
service_logfile='/home/cjdroute/cjdns/cjdroute.log'
|
service_logfile='/home/cjdns/cjdns/cjdroute.log'
|
||||||
|
|
||||||
cjdroute_tun_interface='cjd0'
|
cjdroute_tun_interface='cjd0'
|
||||||
cjdroute_ipv6_addr='<put your ipv6 address here>'
|
cjdroute_ipv6_addr='fca7:8aef:6571:63c5:b23c:2fbc:8dea:e207/8'
|
||||||
|
cjdroute_listen_port='7530'
|
||||||
|
|
||||||
cjdroute.create_tun() {
|
cjdroute.create_tun() {
|
||||||
ip tuntap add mode tun user "$service_username" group "$service_username" "$cjdroute_tun_interface"
|
ip tuntap add mode tun user "$service_username" group "$service_username" "$cjdroute_tun_interface"
|
||||||
|
@ -22,10 +22,11 @@ cjdroute.destroy_tun() {
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
[[ "$cjdroute_tun_interface" ]] && { cjdroute.create_tun; } && watchman.start
|
cjdroute.create_tun && watchman.start
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
killall cjdroute
|
service_pid=`lsof -i :"$cjdroute_listen_port" | tail -1 | cut -d ' ' -f 2`
|
||||||
|
watchman.stop
|
||||||
cjdroute.destroy_tun
|
cjdroute.destroy_tun
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user