Further improvements to alive checker

This commit is contained in:
mathiascode 2020-03-17 05:59:15 +02:00
parent 0dfa4a9b5b
commit d7a44e2f7a
3 changed files with 3 additions and 6 deletions

View file

@ -16,7 +16,7 @@ while true; do
if [ "$(env printf '\xFE' | nc -w 15 play.kaboom.pw 25565 | wc -m)" -eq 0 ]; then
pkill -9 java
kill -9 `cat $AUTOSSH_PIDFILE`
kill -9 $PROXY_PID
echo $(date) >> kill.log
fi
#fi

View file

@ -3,7 +3,6 @@
# This is the core script that Heroku uses when booting up a dyno
PATH="$HOME/autossh/bin/:$HOME/dtach/bin/:$HOME/java/bin/:$PATH"
export AUTOSSH_PIDFILE=$HOME/autossh.pid
# Set up SSH for proxy server and schematics repository
# Load keys from environmental variables

View file

@ -7,14 +7,12 @@
set -x
while true; do
autossh -M 0 \
-o "ServerAliveInterval 30" \
-o "ServerAliveCountMax 3" \
-i ~/.ssh/proxy \
ssh -i ~/.ssh/proxy \
-o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o StreamLocalBindUnlink=yes \
-c aes128-ctr \
-C -S none -N -T -R \
25565:localhost:25565 \
remote@play.kaboom.pw
export PROXY_PID=$!
sleep 1
done