forked from krkeegan/misterhouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmhl
executable file
·44 lines (31 loc) · 936 Bytes
/
mhl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
# This is a linux shell mh loop for restarting mh if mh had an unexpected exit
# If you want to use it, call it in the same way you would call mh.
# Call Switch User if you call this script as root so mh does not run as root
# su xyz
# Set current working directory to location of this script (bin/)
cd "$( cd "$( dirname "$0" )" && pwd )"
while [ 1 = 1 ]; do
echo
echo Deleting startup file
# rm -f mh.started
touch mh.startup
# Avoid a memory leak problem in Red Hat 8
export LANG=C
echo Running mh
perl mh "$@"
rc=$?
echo mh rc=$rc
if [ $rc = 1 ]; then
echo mh exited normally
exit
fi
# if [ ! -f mh.started ]; then
if [ -f mh.startup ]; then
echo mh failed on startup ... will not restart
exit
fi
echo mh had an unexpected exit ... sleep a bit, then restarting
date >> mh_restart.log
sleep 5
done