2003-07-09 00:59:57 +02:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
# stop server if it is running
|
|
|
|
|
|
|
|
|
|
|
|
stopServerIfRunning() {
|
|
|
|
|
2003-09-08 21:31:12 +02:00
|
|
|
checkString=`ps -ef| egrep "(ibserver|ibguard|fbserver|fbguard)" |grep -v grep`
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
if [ ! -z "$checkString" ]
|
|
|
|
then
|
2003-10-27 19:00:44 +01:00
|
|
|
InitFile=/etc/init.d/firebird
|
|
|
|
if [ ! -x $InitFile ]
|
|
|
|
then
|
|
|
|
InitFile=/etc/rc.d/init.d/firebird
|
|
|
|
fi
|
|
|
|
if [ ! -x $InitFile ]
|
|
|
|
then
|
|
|
|
InitFile=/usr/sbin/rcfirebird
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -x $InitFile ]
|
|
|
|
then
|
|
|
|
$InitFile stop
|
|
|
|
fi
|
2003-07-09 00:59:57 +02:00
|
|
|
fi
|
2003-10-27 19:00:44 +01:00
|
|
|
|
|
|
|
# Stop lock manager if it is the only thing running.
|
|
|
|
|
|
|
|
for i in `ps -ef | grep "gds_lock_mgr" | grep -v "grep" | cut -d' ' -f3`
|
|
|
|
do
|
|
|
|
kill $i
|
|
|
|
done
|
|
|
|
|
2003-07-09 00:59:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#= Main PreUn ================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-09-24 00:38:48 +02:00
|
|
|
IBRootDir=@prefix@
|
2003-07-09 00:59:57 +02:00
|
|
|
IBBin=$IBRootDir/bin
|
2003-10-27 19:00:44 +01:00
|
|
|
SecurityDatabase=security.fdb
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
stopServerIfRunning
|
|
|
|
|
|
|
|
cd $IBRootDir
|
2003-09-08 21:31:12 +02:00
|
|
|
if [ -f $SecurityDatabase ]
|
2003-07-09 00:59:57 +02:00
|
|
|
then
|
2003-09-08 21:31:12 +02:00
|
|
|
cp $SecurityDatabase /tmp
|
|
|
|
echo "Saved a copy of SecurityDatabase ($SecurityDatabase) in /tmp"
|
2003-07-09 00:59:57 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2003-09-08 21:31:12 +02:00
|
|
|
for i in isc_init1* isc_event1* isc_lock1* isc_guard* firebird.log SYSDBA.password
|
2003-07-09 00:59:57 +02:00
|
|
|
do
|
|
|
|
if [ -f $i ]
|
|
|
|
then
|
|
|
|
rm -f $i
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
2003-09-08 21:31:12 +02:00
|
|
|
rm -f $IBBin/fbmgr
|
2003-07-09 00:59:57 +02:00
|
|
|
|
2003-09-08 21:31:12 +02:00
|
|
|
userdel firebird
|