#!/bin/sh # # The contents of this file are subject to the Initial # Developer's Public License Version 1.0 (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.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl. # # Software distributed under the License is distributed AS IS, # 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 was created by Paul Beach # based on the original Posix script created by Alex Peshkov # for the Firebird Open Source RDBMS project. # # Copyright (c) 2009 Paul Beach # Alex Peshkov # and all contributors signed below. # # All Rights Reserved. # Contributor(s): ______________________________________. # FB_FW=/Library/Frameworks/Firebird.framework/ FB_RES=@prefix@/Versions/A/Resources cat < /etc/.fb.inetd.conf.entry cat /etc/inetd.conf /etc/.fb.inetd.conf.entry > /etc/.firebird.temp.install.inetd.conf mv /etc/.firebird.temp.install.inetd.conf /etc/inetd.conf rm -f /etc/.fb.inetd.conf.entry HUPNEEDED='y' fi fi #xinetd if [ -f /etc/xinet.d ]; then cat > /etc/xinetd.d/firebird <> /etc/xinetd.d/firebird cat >> /etc/xinetd.d/firebird << EOF groups = yes } EOF HUPNEEDED='y' fi #launchd cp $FB_FW/Resources/org.firebird.gds.plist /Library/LaunchDaemons/org.firebird.gds.plist launchctl load /Library/LaunchDaemons/org.firebird.gds.plist # Tell inetd/xinetd to reload their configuration files. echo "hupneeded" if [ "$HUPNEEDED" = 'y' ]; then if [ -f /var/run/inetd.pid ]; then kill -HUP `cat /var/run/inetd.pid` fi if [ -f /var/run/xinetd.pid ]; then kill -HUP `cat /var/run/xinetd.pid` fi fi fi ;; thread) if [ -f "$FB_FW/Versions/A/Resources/.SuperServer" ]; then echo "You are already in SuperClassic mode" else # Check if Classic is running echo "Check if Classic is running" if ps -axe | grep "fb_smp_server" | grep -v grep then echo "An instance of the Firebird Classic Server seems to be running." echo "Please exit all Firebird applications before continuing." fi # Remove the Classic installation echo "Removing the Classic installation" #inetd (old) echo "inetd" if [ -f /etc/inetd.conf ]; then grep -s gds_db /etc/inetd.conf > /dev/null 2>&1 if test $? != 0 ; then cat /etc/inetd.conf | grep -v gds_db > /etc/.firebird.temp.install.inetd.conf mv /etc/.firebird.temp.install.inetd.conf /etc/inetd.conf HUPNEEDED='y' fi fi #xinetd (pre 10.5) echo "xinetd" if [ -f /etc/xinetd.d/firebird ]; then rm /etc/xinetd.d/firebird HUPNEEDED='y' fi # Tell inetd/xinetd to reload their configuration files. echo "hupneeded" if [ "$HUPNEEDED" = 'y' ]; then if [ -f /var/run/inetd.pid ]; then kill -HUP `cat /var/run/inetd.pid` fi if [ -f /var/run/xinetd.pid ]; then kill -HUP `cat /var/run/xinetd.pid` fi fi #launchd echo "launchd" if [ -f /Library/LaunchDaemons/org.firebird.gds.plist ]; then launchctl unload /Library/LaunchDaemons/org.firebird.gds.plist rm /Library/LaunchDaemons/org.firebird.gds.plist fi # Install and start SuperClassic echo "install and start SuperClassic" touch $FB_FW/Versions/A/Resources/.SuperServer cp -r $FB_FW/Resources/FirebirdSS /Library/StartupItems/Firebird if [ -f "$FB_FW/Versions/A/Resources/.SuperServer" ]; then chmod u+xg+xo+x /Library/StartupItems/Firebird/Firebird /Library/StartupItems/Firebird/Firebird start fi fi ;; *) echo "unknown option $multianswer chosen" exit 1 ;; esac