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

View File

@ -24,7 +24,18 @@ cjdroute.destroy_tun() {
ip tuntap del mode tun "$cjdroute_tun_interface" 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() { start() {
cjdroute.check_tun_module || { return 1; }
[[ "$service_username" ]] && { [[ "$service_username" ]] && {
cjdroute.create_tun || { return 1; } cjdroute.create_tun || { return 1; }
} }