forked from Neo-Desktop/Autobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto
executable file
·53 lines (44 loc) · 1.26 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-2011 Xelhua Development Group, et al.
# Written in sh because the user may not have Perl...to run Auto....
PID=bin/auto.pid
MODS="Class::Unload DBI"
if [ "$1" = "start" ] ; then
if [ -e $PID ]; then
if [ "$2" = "force" ]; then
echo "Starting Auto. . ."
bin/auto
sleep 2
if [ ! -r $PID ]; then
echo "Possible failed startup... check Auto logs for more information."
fi
else
echo "Auto appears to be running already. Run ./auto start force to start anyway."
fi
else
echo "Starting Auto. . ."
bin/auto
sleep 2
if [ ! -r $PID ]; then
echo "Possible failed startup... check Auto logs for more information"
fi
fi
elif [ "$1" = "stop" ]; then
echo "Stopping Auto. . ."
kill -TERM `cat $PID`
elif [ "$1" = "rehash" ]; then
echo "Rehashing Auto. . ."
kill -HUP `cat $PID`
elif [ "$1" = "status" ]; then
if [ -e $PID ]; then
echo "Status: Auto appears to be running."
else
echo "Status: Auto 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: