~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to support-files/MacOSX/MySQLCOM

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# /Library/StartupItems/MySQLCOM/MySQLCOM
 
4
#
 
5
# A script to automatically start up MySQL on system bootup
 
6
# for Mac OS X. This is actually just a wrapper script around
 
7
# the standard mysql.server init script, which is included in
 
8
# the binary distribution.
 
9
#
 
10
# (c) 2003 MySQL AB
 
11
# Written by Lenz Grimmer <lenz@mysql.com>
 
12
#
 
13
 
 
14
# Suppress the annoying "$1: unbound variable" error when no option
 
15
# was given
 
16
if [ -z $1 ] ; then
 
17
        echo "Usage: $0 [start|stop|restart] "
 
18
        exit 1
 
19
fi
 
20
 
 
21
# Source the common setup functions for startup scripts
 
22
test -r /etc/rc.common || exit 1
 
23
. /etc/rc.common
 
24
 
 
25
# The path to the mysql.server init script. The official MySQL
 
26
# Mac OS X packages are being installed into /usr/local/mysql.
 
27
SCRIPT="/usr/local/mysql/support-files/mysql.server"
 
28
 
 
29
StartService ()
 
30
{
 
31
        if [ "${MYSQLCOM:=-NO-}" = "-YES-" ] ; then
 
32
                ConsoleMessage "Starting MySQL database server"
 
33
                $SCRIPT start > /dev/null 2>&1
 
34
        fi
 
35
}
 
36
 
 
37
StopService ()
 
38
{
 
39
        ConsoleMessage "Stopping MySQL database server"
 
40
        $SCRIPT stop > /dev/null 2>&1
 
41
}
 
42
 
 
43
RestartService ()
 
44
{
 
45
        ConsoleMessage "Restarting MySQL database server"
 
46
        $SCRIPT restart > /dev/null 2>&1
 
47
}
 
48
 
 
49
if test -x $SCRIPT ; then
 
50
        RunService "$1"
 
51
else
 
52
        ConsoleMessage "Could not find MySQL startup script!"
 
53
fi