forked from RussellB28/RedStone-Legacy
/
auto
executable file
·53 lines (44 loc) · 1.31 KB
/
auto
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
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
# auto - Launcher.
# Copyright (C) 2010-2014 RedStone Development Group, et al.
# Written in sh because the user may not have Perl...to run RedStone....
PID=bin/redstone.pid
MODS="Class::Unload DBI"
if [ "$1" = "start" ] ; then
if [ -e $PID ]; then
if [ "$2" = "force" ]; then
echo "Starting RedStone. . ."
bin/auto
sleep 2
if [ ! -r $PID ]; then
echo "Possible failed startup... check RedStone logs for more information."
fi
else
echo "RedStone appears to be running already. Run ./auto start force to start anyway."
fi
else
echo "Starting RedStone. . ."
bin/auto
sleep 2
if [ ! -r $PID ]; then
echo "Possible failed startup... check RedStone logs for more information"
fi
fi
elif [ "$1" = "stop" ]; then
echo "Stopping RedStone. . ."
kill -TERM `cat $PID`
elif [ "$1" = "rehash" ]; then
echo "Rehashing RedStone. . ."
kill -HUP `cat $PID`
elif [ "$1" = "status" ]; then
if [ -e $PID ]; then
echo "Status: RedStone appears to be running."
else
echo "Status: RedStone appears to not be running."
fi
elif [ "$1" = "getmodules" ]; then
cpan -i $MODS
else
echo "Usage: auto (start|stop|rehash|status|getmodules)"
fi
# vim: set ai et sw=4 ts=4: