From 16eabb36c18d6442da3742f09d8210239d9faba5 Mon Sep 17 00:00:00 2001 From: mathias Date: Sun, 11 Nov 2018 21:45:48 +0200 Subject: [PATCH] Move watchdog away from tmux --- bin/start | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/bin/start b/bin/start index 8ff60e9..ae762be 100755 --- a/bin/start +++ b/bin/start @@ -19,16 +19,6 @@ done' sleep 60 -.bin/tmux new -d -s watchdog 'while true; do - sleep 120 - if [ "$(echo -n -e '\xFE' | nc -w 1 localhost 25565 | wc -m)" -eq 0 ]; then - echo -n -e '\xFE' | nc -w 1 localhost 25565 | wc -m - kill -9 $(pgrep java) - echo "killed" - echo -n -e '\xFE' | nc -w 1 localhost 25565 | wc -m - fi -done' - .bin/tmux new -d -s schematics 'while true; do cd $HOME/plugins/WorldEdit/schematics/ if [ "git status --porcelain" ]; then @@ -39,4 +29,11 @@ done' sleep 1 done' +while true; do + sleep 120 + if [ "$(echo -n -e '\xFE' | nc -w 1 localhost 25565 | wc -m)" -eq 0 ]; then + kill -9 $(pgrep java) + fi +done & + sleep infinity