Skip to content

Instantly share code, notes, and snippets.

@ego008
Forked from c2h2/kcptun_template.sh
Created April 22, 2019 09:37
Show Gist options
  • Save ego008/2a6c2d71a6173e0b4230c87cc2afb42c to your computer and use it in GitHub Desktop.
Save ego008/2a6c2d71a6173e0b4230c87cc2afb42c to your computer and use it in GitHub Desktop.
kcptun template
HOST=yourhost.com:38989
LISTEN=12345 #example port
KEY=your_very_secure_long_long_key
echo $HOST $LISTEN $KEY
#kill first
kill $(ps aux | grep ${LISTEN} | awk '{print $2}');
#main proc
while true; do ./client_linux_amd64 -r "${HOST}" -l ":${LISTEN}" --crypt aes --key ${KEY} --mtu 1350 --sndwnd 128 --rcvwnd 1024 --mode fast2 --quiet; sleep 2; done &
#watchdog
while true; do sleep 3600; kill $(ps aux | grep ${LISTEN} | awk '{print $2}'); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment