From 8d972de8b8c9de9ba5fc19c09b2e2189f972b3c1 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Tue, 29 Sep 2015 04:36:45 +0200 Subject: [PATCH] Fix irssi screen connection wait. --- other/screen-irssi.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/other/screen-irssi.sh b/other/screen-irssi.sh index 0bfdd4a..4f11aa2 100644 --- a/other/screen-irssi.sh +++ b/other/screen-irssi.sh @@ -1,3 +1,13 @@ #!/bin/sh + +# Wait until online. +online=0 +while [ $online -eq 0 ]; do + ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && \ + online=1 || online=0 +done +echo 1 + +# Start irssi in shell in screen. screen -d -m -S irssi screen -S irssi -X stuff 'irssi\n' -- 2.30.2