2 # Short script to help keeping weechat alive
3 if test $
(ps x |
grep SCREEN |
grep weechat-curses |
grep -v grep |
wc -l) -gt 0
5 # screen process with ID weechat is running, exit silently
8 # No screen process with ID weechat is running, restart screen
9 screen
-U -d -m -s /bin
/bash
-S weechat
-T screen-256color weechat-curses