From 786a748526ff8b83773ad389dc37a3f87944d526 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Einar=20J=C3=B8rgen=20Haraldseid?= Date: Thu, 5 Jun 2014 16:09:11 +0200 Subject: [PATCH] check_weechat - a small script to keep weechat alive, suitable for crontab --- check_weechat | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 check_weechat diff --git a/check_weechat b/check_weechat new file mode 100755 index 0000000..259d26b --- /dev/null +++ b/check_weechat @@ -0,0 +1,10 @@ +#!/bin/bash +# Short script to help keeping weechat alive +if test $(ps x | grep SCREEN | grep weechat-curses | grep -v grep | wc -l) -gt 0 +then + # screen process with ID weechat is running, exit silently + exit 0 +else + # No screen process with ID weechat is running, restart screen + screen -U -d -m -s /bin/bash -S weechat -T screen-256color weechat-curses +fi -- 2.30.2