projects
/
serene-ircd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3bdcafb
)
Add simple script to check for running ircd in cron
author
Remco Rijnders
<remco@webconquest.com>
Sat, 7 Dec 2013 11:57:41 +0000
(12:57 +0100)
committer
Remco Rijnders
<remco@webconquest.com>
Sat, 7 Dec 2013 12:17:22 +0000
(13:17 +0100)
ircdchk
[new file with mode: 0755]
patch
|
blob
diff --git a/ircdchk
b/ircdchk
new file mode 100755
(executable)
index 0000000..
7dcb813
--- /dev/null
+++ b/
ircdchk
@@ -0,0
+1,18
@@
+# simple ircdchk
+# edit where applicable
+# crontab: */7 * * * * /home/ircd/ircd/ircdchk
+
+ircdexe="/home/ircd/ircd/ircd"
+ircdpidfile="/home/ircd/ircd/ircd.pid"
+
+if test -r $ircdpidfile; then
+ ircdpid=`cat $ircdpidfile`
+ if `kill -CHLD $ircdpid >/dev/null 2>&1`; then
+ # running process, exit without output
+ exit 0
+ fi
+ echo "Stale PID $ircdpidfile, removing"
+ rm -f $ircdpidfile
+fi
+echo "Restarting stopped ircd"
+$ircdexe