2017-07-13 13:09:42 +00:00
|
|
|
#!/usr/bin/env ssm
|
2014-07-24 20:31:44 +00:00
|
|
|
# Two warnings:
|
|
|
|
# 1) This script uses a script to run cjdroute and feed it
|
2017-07-13 13:09:42 +00:00
|
|
|
# the config. It can be found in the main cjdns repo:
|
|
|
|
# contrib/sh/run-cjdroute.sh
|
|
|
|
# Or here: http://ix.io/fYT
|
2014-07-24 20:31:44 +00:00
|
|
|
# 2) service_respawn is disabled by default because you need
|
|
|
|
# "noBackground":1 in cjdroute.conf for it to actually work.
|
|
|
|
# Barely.
|
2013-11-05 14:10:22 +00:00
|
|
|
|
|
|
|
unset reload
|
|
|
|
|
2017-07-13 13:09:42 +00:00
|
|
|
service_respawn=true
|
2014-09-30 04:49:21 +00:00
|
|
|
service_command='/usr/bin/run-cjdroute'
|
2014-04-05 19:59:52 +00:00
|
|
|
cjdroute_admin_port='11234'
|
2013-11-05 14:10:22 +00:00
|
|
|
|
2013-11-13 07:04:27 +00:00
|
|
|
cjdroute.check_tun_module() {
|
|
|
|
[[ -e '/dev/net/tun' ]] || {
|
|
|
|
modprobe tun || {
|
2017-07-13 13:09:42 +00:00
|
|
|
printf 'Could not load module tun!\n'
|
2013-11-13 07:04:27 +00:00
|
|
|
return 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-13 13:09:42 +00:00
|
|
|
pre_start() {
|
|
|
|
cjdroute.check_tun_module
|
2013-11-05 14:10:22 +00:00
|
|
|
}
|