#!/bin/bash : <<-'EOF' Copyright 2017 Xingwang Liao Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. EOF export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin # 版本信息,请勿修改 # ================= SHELL_VERSION=20 CONFIG_VERSION=6 INIT_VERSION=3 # ================= KCPTUN_INSTALL_DIR='/usr/local/kcptun' KCPTUN_LOG_DIR='/var/log/kcptun' KCPTUN_RELEASES_URL='https://api.github.com/repos/xtaci/kcptun/releases' KCPTUN_LATEST_RELEASE_URL="${KCPTUN_RELEASES_URL}/latest" KCPTUN_TAGS_URL='https://github.com/xtaci/kcptun/tags' BASE_URL='https://github.com/kuoruan/shell-scripts/raw/master/kcptun' SHELL_VERSION_INFO_URL="${BASE_URL}/version.json" JQ_LINUX32_URL="${BASE_URL}/bin/jq-linux32" JQ_LINUX64_URL="${BASE_URL}/bin/jq-linux64" JQ_LINUX32_HASH='5ac55877f41916b80fe546e16d58678cca9aae6d' JQ_LINUX64_HASH='d8e36831c3c94bb58be34dd544f44a6c6cb88568' JQ_BIN="${KCPTUN_INSTALL_DIR}/bin/jq" SUPERVISOR_SERVICE_FILE_DEBIAN_URL="${BASE_URL}/startup/supervisord.init.debain" SUPERVISOR_SERVICE_FILE_REDHAT_URL="${BASE_URL}/startup/supervisord.init.redhat" SUPERVISOR_SYSTEMD_FILE_URL="${BASE_URL}/startup/supervisord.systemd" # 默认参数 # ======================= D_LISTEN_PORT=29900 D_TARGET_ADDR='127.0.0.1' D_TARGET_PORT=12984 D_KEY="very fast" D_CRYPT='aes' D_MODE='fast' D_MTU=1350 D_SNDWND=512 D_RCVWND=512 D_DATASHARD=10 D_PARITYSHARD=3 D_DSCP=0 D_NOCOMP='false' D_QUIET='false' D_SNMPPERIOD=60 D_PPROF='false' # 隐藏参数 D_ACKNODELAY='false' D_NODELAY=1 D_INTERVAL=20 D_RESEND=2 D_NC=1 D_SOCKBUF=4194304 D_KEEPALIVE=10 # ====================== # 当前选择的实例 ID current_instance_id= run_user='kcptun' clear cat >&1 <<-'EOF' ######################################################### # Kcptun 服务端一键安装脚本 # # 该脚本支持 Kcptun 服务端的安装、更新、卸载及配置 # # 脚本作者: Index # # 作者博客: https://blog.kuoruan.com/ # # Github: https://github.com/kuoruan/shell-scripts # # QQ交流群: 43391448, 68133628 # # 633945405 # ######################################################### EOF usage() { cat >&1 <<-EOF 请使用: $0