Forked from zjx20/gist:1c7f4dd1392866f9d8b00dd2a05bd481
Last active
July 26, 2019 06:15
-
-
Save br41n10/1013c8d77c2c12cb74f85e902bcb7525 to your computer and use it in GitHub Desktop.
kcptun server install and systemd daemon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://github.com/xtaci/kcptun/releases/download/v20190725/kcptun-linux-amd64-20190725.tar.gz | |
tar xvf kcptun-linux-amd64-20190725.tar.gz | |
sudo mv server_linux_amd64 /usr/local/bin/kcptun_server | |
sudo mv client_linux_amd64 /usr/local/bin/kcptun_client | |
sudo mkdir -p /etc/kcptun | |
sudo bash -c "cat <<EOT > /etc/kcptun/server_conf.json | |
{ | |
\"listen\": \":4001\", | |
\"target\": \"127.0.0.1:8311\", | |
\"mode\": \"normal\", | |
\"crypt\": \"aes-128\", | |
\"key\": \"PASSWORD\" | |
} | |
EOT" | |
sudo bash -c "cat <<EOT > /etc/systemd/system/kcptun_server.service | |
[Unit] | |
Description=Kcptun server | |
Requires=network.target | |
After=network-online.target | |
[Service] | |
Type=simple | |
User=nobody | |
RemainAfterExit=yes | |
ExecStart=/usr/local/bin/kcptun_server -c /etc/kcptun/server_conf.json | |
ExecReload=/usr/bin/kill -HUP $MAINPID | |
RestartSec=1min | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target | |
EOT" | |
sudo systemctl enable kcptun_server | |
sudo systemctl start kcptun_server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment