3
# postinstall script for the MySQL Startup Item Installation package
5
# This script modifies /etc/hostconfig in the following ways:
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
14
# Author: Lenz Grimmer <lenz@mysql.com>
17
CONFFILE="/etc/hostconfig"
18
TMPFILE=`basename $CONFFILE` || exit 1
19
TMPFILE=`mktemp -t $TMPFILE.tmp` || exit 1
21
test -e $CONFFILE || exit 1
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
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
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!"