#!/bin/sh : <<-'EOF' Copyright 2017-2019 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=26 CONFIG_VERSION=7 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_DOWNLOAD_URL="https://github.com/stedolan/jq/releases/download/jq-1.5/" JQ_LINUX32_URL="${JQ_DOWNLOAD_URL}/jq-linux32" JQ_LINUX64_URL="${JQ_DOWNLOAD_URL}/jq-linux64" JQ_LINUX32_HASH='ab440affb9e3f546cf0d794c0058543eeac920b0cd5dff660a2948b970beb632' JQ_LINUX64_HASH='c6b3a7d7d3e7b70c6f51b706a3b90bd01833846c54d32ca32f0027f00226ff6d' 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='true' D_QUIET='false' D_TCP='false' D_SNMPPERIOD=60 D_PPROF='false' # 隐藏参数 D_ACKNODELAY='false' D_NODELAY=1 D_INTERVAL=20 D_RESEND=2 D_NC=1 # SMUX提高到64M提高SreamBuf效果 D_SOCKBUF=67108868 D_SMUXBUF=67108868 D_KEEPALIVE=10 # KCP新版支持,SMux默认为2,BUF大小改为16M D_SMUXVER=2 D_STREAMBUF=16777217 # ====================== # 当前选择的实例 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