Files
Autobot/auto
T
2011-02-20 20:46:10 -07:00

54 lines
1.3 KiB
Bash
Executable File

#!/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
ssssif [ -e $PID ]; then
ssss if [ "$2" = "force" ]; then
ssss echo "Starting Auto. . ."
ssss bin/auto
ssss sleep 2
ssss if [ ! -r $PID ]; then
ssss echo "Possible failed startup... check Auto logs for more information."
ssss fi
else
echo "Auto appears to be running already. Run ./auto start force to start anyway."
fi
sssselse
ssss echo "Starting Auto. . ."
ssss bin/auto
ssss sleep 2
ssss if [ ! -r $PID ]; then
ssss echo "Possible failed startup... check Auto logs for more information"
ssss fi
ssssfi
elif [ "$1" = "stop" ]; then
ssssecho "Stopping Auto. . ."
sssskill -TERM `cat $PID`
elif [ "$1" = "rehash" ]; then
ssssecho "Rehashing Auto. . ."
sssskill -HUP `cat $PID`
elif [ "$1" = "status" ]; then
ssssif [ -e $PID ]; then
ssss echo "Status: Auto appears to be running."
sssselse
ssss echo "Status: Auto appears to not be running."
ssssfi
elif [ "$1" = "getmodules" ]; then
sssscpan -i $MODS
else
ssssecho "Usage: auto (start|stop|rehash|status|getmodules)"
fi
# vim: set ai sw=4 ts=4: