diff --git a/init.d/cjdroute b/init.d/cjdroute index a759550..5d33f5f 100755 --- a/init.d/cjdroute +++ b/init.d/cjdroute @@ -24,7 +24,18 @@ cjdroute.destroy_tun() { ip tuntap del mode tun "$cjdroute_tun_interface" } +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_username" ]] && { cjdroute.create_tun || { return 1; } }