This commit is contained in:
mcafee%netscape.com 2000-01-31 20:43:10 +00:00
Родитель 8b85fc4a60
Коммит 99a25ca4b6
1 изменённых файлов: 51 добавлений и 50 удалений

Просмотреть файл

@ -1,24 +1,24 @@
#!/bin/sh
#
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
#
# The Original Code is Mozilla Communicator.
#
#
# The Initial Developer of the Original Code is Chris McAfee.
# Portions created by Chris McAfee are
# Copyright (C) The Mozilla Organization.
# All Rights Reserved.
#
#
# Contributor(s): Chris McAfee <mcafee@netscape.com>
#
#
#
# Tinderbox control script.
@ -27,6 +27,19 @@
# simultaneously, depend and clobber.
#
tinderbox_usage() {
echo "Usage: tinderbox [depend|clobber] {start|stop|status|restart}"
exit 1
}
if [ $# != 2 ]; then
echo "Wrong number of arguments."
tinderbox_usage
fi
build_type="$1"
build_action="$2"
# Depend or clobber build?
case "$1" in
depend)
@ -36,59 +49,47 @@ case "$1" in
treeOption="clobber"
;;
*)
echo "Usage: tinderbox [depend|clobber] {start|stop|status|restart}"
tinderbox_usage
exit 1
esac
# See how we were called.
case "$2" in
case "$build_action" in
start)
echo -n "Starting "
echo -n $1
echo -n " tinderbox..."
if test -f $1.pid; then
echo -n $1
echo -n " build already running with PID "
cat $1.pid
else
nohup ./build-seamonkey.pl --$treeOption &
echo -n " PID "
echo $!
echo $! > $1.pid
fi
;;
stop)
echo -n "Shutting down "
echo -n $1
echo " tinderbox..."
if test -f $1.pid; then
echo "kill -9 `cat $1.pid`"
kill -9 `cat $1.pid`
\rm $1.pid
fi
echo
;;
status)
if test -f $1.pid; then
echo -n $1
echo -n " build is running with PID of "
cat $1.pid
echo "Starting $build_type tinderbox..."
if test -f $build_type.pid; then
echo "$build_type build already running with PID "`cat $build_type.pid`
else
echo -n $1
echo " build is not running."
nohup ./build-seamonkey.pl --$build_type &
echo "PID $$"
echo $$ > $build_type.pid
fi
;;
;;
stop)
echo "Shutting down $build_type tinderbox..."
if test -f $build_type.pid; then
pid=`cat $build_type.pid`
echo "kill $pid"
kill `$pid`
\rm $build_type.pid
fi
echo
;;
status)
if test -f $build_type.pid; then
echo "$build_type build is running with PID of "`cat $build_type.pid`
else
echo "$build_type build is not running."
fi
;;
restart)
echo -n "Restarting "
echo -n $1
echo " tinderbox:"
$0 $1 stop
$0 $1 start
;;
echo "Restarting $build_type tinderbox:"
$0 $build_type stop
$0 $build_type start
;;
*)
echo "Usage: tinderbox [depend|clobber] {start|stop|status|restart}"
exit 1
tinderbox_usage
exit 1
esac
exit 0