~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to support-files/MacOSX/StartupItem.postinstall

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# postinstall script for the MySQL Startup Item Installation package
 
4
#
 
5
# This script modifies /etc/hostconfig in the following ways:
 
6
#
 
7
# - On Mac OS X Server, it disables the startup of the default MySQL
 
8
#   installation by changing the "MYSQL" start variable to "-NO-".
 
9
# - If not existent already, it adds a "MYSQLCOM" start variable, which
 
10
#   defaults to "-YES-". An already existing MYSQLCOM variable will remain
 
11
#   untouched.
 
12
#
 
13
# (c) 2003 MySQL AB
 
14
# Author: Lenz Grimmer <lenz@mysql.com>
 
15
#
 
16
 
 
17
CONFFILE="/etc/hostconfig"
 
18
TMPFILE=`basename $CONFFILE` || exit 1
 
19
TMPFILE=`mktemp -t $TMPFILE.tmp` || exit 1
 
20
 
 
21
test -e $CONFFILE || exit 1
 
22
 
 
23
# Disable the startup of the default MySQL installation that ships with
 
24
# Mac OS X Server to avoid conflicts with our installation on bootup
 
25
sed -e s/^MYSQL=-YES-/MYSQL=-NO-/g < $CONFFILE > $TMPFILE
 
26
 
 
27
# Add our MYSQLCOM startup variable (enabled by default)
 
28
grep -q "^MYSQLCOM" $CONFFILE > /dev/null 2>&1
 
29
if [ $? -ne 0 ] ; then
 
30
        echo "MYSQLCOM=-YES-" >> $TMPFILE
 
31
fi
 
32
 
 
33
# Install the modified file into the default location
 
34
cp -f $CONFFILE $CONFFILE~ || exit 1
 
35
mv -f $TMPFILE $CONFFILE || echo "Error while installing new $CONFFILE!"
 
36
chmod 644 $CONFFILE