diff --git a/glorytun/init b/glorytun/init index fbf024c27..e6f8864fc 100755 --- a/glorytun/init +++ b/glorytun/init @@ -41,12 +41,19 @@ start_instance() { [ "${enable}" = "1" ] || return 1 [ "${proto}" = "tcp" ] || return 1 - [ -n "${key}" ] || return 1 + [ -n "${key}" ] || { + _err "Key empty" + return 1 + } [ "${key}" != "secretkey" ] || return 1 [ -n "${port}" ] || return 1 [ -n "${dev}" ] || return 1 echo "${key}" > /tmp/${PROG_NAME}-${1}.key + [ -f "/tmp/${PROG_NAME}-${1}.key" ] || { + _err "can't create key file" + return 1 + } key="" if [ "$(uci -q get network.omrvpn)" != "" ]; then @@ -69,9 +76,9 @@ start_instance() { procd_append_param command \ retry count -1 const 50000 \ - timeout 40000 \ - keepalive count 5 idle 60 interval 2 \ - buffer-size 65500 + timeout 4000 \ + keepalive count 5 idle 30 interval 2 \ + buffer-size 1000 procd_set_param respawn 0 30 0 procd_set_param file /tmp/${PROG_NAME}-${1}.key