| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
#------------------------------------------------------------------------ |
| 4 |
# remove line from config file if it exists in it. |
| 5 |
|
| 6 |
removeLineFromFile() { |
| 7 |
FileName=$1 |
| 8 |
oldLine=$2 |
| 9 |
|
| 10 |
if [ ! -z "$oldLine" ] |
| 11 |
then |
| 12 |
cat $FileName | grep -v "$oldLine" > ${FileName}.tmp |
| 13 |
mv ${FileName}.tmp $FileName |
| 14 |
echo "Updated." |
| 15 |
|
| 16 |
fi |
| 17 |
} |
| 18 |
|
| 19 |
|
| 20 |
#------------------------------------------------------------------------ |
| 21 |
# removeLinksForBackCompatibility |
| 22 |
# Remove links for back compatibility to InterBase and Firebird1.0 |
| 23 |
# linked systems. |
| 24 |
|
| 25 |
removeLinksForBackCompatibility() { |
| 26 |
|
| 27 |
if [ -L @libdir@/libgds.so ] |
| 28 |
then |
| 29 |
rm -f @libdir@/libgds.so |
| 30 |
fi |
| 31 |
if [ -L @libdir@/libgds.so.0 ] |
| 32 |
then |
| 33 |
rm -f @libdir@/libgds.so.0 |
| 34 |
fi |
| 35 |
|
| 36 |
} |
| 37 |
|
| 38 |
#= Main PostUn =============================================================== |
| 39 |
|
| 40 |
|
| 41 |
if [ "$1"=0 ] |
| 42 |
then |
| 43 |
|
| 44 |
removeLinksForBackCompatibility |
| 45 |
|
| 46 |
|
| 47 |
# If we have right systems remove the service autoconfig stuff. |
| 48 |
if [ -x sbin/insserv ] |
| 49 |
then |
| 50 |
sbin/insserv /etc/init.d/ |
| 51 |
fi |
| 52 |
|
| 53 |
if [ -x sbin/chkconfig ] |
| 54 |
then |
| 55 |
/sbin/chkconfig --del firebird |
| 56 |
fi |
| 57 |
|
| 58 |
# Remove /usr/sbin/rcfirebird symlink |
| 59 |
|
| 60 |
if [ -e /usr/sbin/rcfirebird ] |
| 61 |
then |
| 62 |
rm -f /usr/sbin/rcfirebird |
| 63 |
fi |
| 64 |
|
| 65 |
# Remove initd script |
| 66 |
|
| 67 |
if [ -e /sbin/init.d/firebird ] |
| 68 |
then |
| 69 |
rm -f /sbin/init.d/firebird |
| 70 |
fi |
| 71 |
|
| 72 |
fi |