checking for the tun module

This commit is contained in:
Jack L. Frost 2013-11-13 11:04:27 +04:00
parent 90d412c91f
commit f9f2106011
1 changed files with 11 additions and 0 deletions

View File

@ -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; }
}