Files
op-packages/luci-app-openvpn-server-client/root/etc/init.d/openvpn-client-cubic
T

30 lines
754 B
Bash
Executable File

#!/bin/sh /etc/rc.common
START=89
STOP=10
USE_PROCD=1
start_service() {
local attempt=0
/usr/libexec/openvpn-client-cubic-route enabled || return 0
# OpenVPN starts at 90. Wait for DNS and the uplink before it connects.
while ! /usr/libexec/openvpn-client-cubic-route update; do
attempt=$((attempt + 1))
[ "$attempt" -lt 12 ] || {
logger -t openvpn-client-cubic 'Could not install CUBIC route before OpenVPN startup'
return 1
}
sleep 2
done
procd_open_instance
procd_set_param command /usr/libexec/openvpn-client-cubic-route watch
procd_set_param respawn 3600 5 -1
procd_close_instance
}
stop_service() {
/usr/libexec/openvpn-client-cubic-route clear
}