diff options
Diffstat (limited to 'net/kcptun/files/kcptun-s.init')
-rw-r--r-- | net/kcptun/files/kcptun-s.init | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/net/kcptun/files/kcptun-s.init b/net/kcptun/files/kcptun-s.init deleted file mode 100644 index cfcb81add..000000000 --- a/net/kcptun/files/kcptun-s.init +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2019 Dengfeng Liu - -START=99 - -USE_PROCD=1 -NAME=kcptun-s -PROG=/usr/bin/${NAME} - -validate_section_kcptun() -{ - uci_load_validate "${NAME}" kcptun "$1" "$2" \ - 'local_port:port' \ - 'target_ip:string' \ - 'target_port:port' \ - 'mode:string' \ - 'nocomp:bool' \ - 'sndwnd:uinteger' \ - 'rcvwnd:uinteger' \ - 'disabled:bool' -} - -kcptun_instance() -{ - [ "$2" = 0 ] || { - echo "validation failed" - return 1 - } - - [ "${disabled}" = "1" ] && return 1 - - [ "${local_port}" -gt 0 ] && [ "${local_port}" -lt 65536 ] || return 1 - - [ "${target_port}" -gt 0 ] && [ "${target_port}" -lt 65536 ] || return 1 - - [ -n "${target_ip}" ] || { - return 1 - } - - procd_open_instance - procd_set_param command "${PROG}" - procd_append_param command --listen ":${local_port}" - procd_append_param command --target "${target_ip}:${target_port}" - [ -n "${mode}" ] && procd_append_param command --mode "${mode}" - [ "${nocomp}" -eq 1 ] && procd_append_param command --nocomp - [ "${sndwnd}" -gt 0 ] && procd_append_param command --sndwnd "${sndwnd}" - [ "${rcvwnd}" -gt 0 ] && procd_append_param command --rcvwnd "${rcvwnd}" - procd_set_param respawn - procd_close_instance -} - -start_service() -{ - config_load "${NAME}" - config_foreach validate_section_kcptun kcptun kcptun_instance -} |