~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2008-06-30 05:41:20 UTC
  • Revision ID: brian@tangent.org-20080630054120-qggcxqh7k7zf09r9
Dead support files, removed gethostbyname_r (we do not use it any longer). 

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