1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#!/bin/bash
# this is a modified version of php3 prerm
set -e
#DEBHELPER#
if [ "$1" != "remove" -a "$1" != "purge" ]; then
exit 0
fi;
if [ -f /etc/apache/httpd.conf ]; then
if grep -q "^LoadModule.*mod_csacek.so" /etc/apache/httpd.conf; then
echo
echo "The apache webserver is configured to load the csacek module at startup"
echo "If you remove this package now, apache will not start";
echo "You should remove the following lines from httpd.conf:"
echo
grep "^LoadModule.*mod_csacek.so" /etc/apache/httpd.conf || true
# grep "^php3" /etc/apache/httpd.conf || true
echo
echo -n "Do you want me to remove ths line for you [y/N] ?"
read a;
if echo $a | grep -iq ^y; then
sed -e 's+^LoadModule.*mod_csacek.so+\#LoadModule csacek_module /usr/lib/apache/1.3/mod_csacek.so+' </etc/apache/httpd.conf >/etc/apache/httpd.conf.php3remove
mv /etc/apache/httpd.conf.php3remove /etc/apache/httpd.conf
else
echo -n "Do you want to remove this package anyway [y/N] ?"
read a;
if echo $a | grep -iq ^y; then
echo
echo "Ok, removing package, dont forget to remove the above mentioned"
echo "lines from /etc/apache/httpd.conf"
read a
else
exit 1
fi
fi
fi
fi
if [ -f /etc/apache-ssl/httpd.conf ]; then
if grep -q "^LoadModule.*mod_csacek.so" /etc/apache-ssl/httpd.conf; then
echo
echo "The apache webserver is configured to load the csacek module at startup"
echo "If you remove this package now, apache will not start";
echo "You should remove the following lines from httpd.conf:"
echo
grep "^LoadModule.*mod_csacek.so" /etc/apache-ssl/httpd.conf || true
# grep "^php3" /etc/apache/httpd.conf || true
echo
echo -n "Do you want me to remove ths line for you [y/N] ?"
read a;
if echo $a | grep -iq ^y; then
sed -e 's+^LoadModule.*mod_csacek.so+\#LoadModule csacek_module /usr/lib/apache/1.3/mod_csacek.so+' </etc/apache-ssl/httpd.conf >/etc/apache-ssl/httpd.conf.php3remove
mv /etc/apache-ssl/httpd.conf.php3remove /etc/apache-ssl/httpd.conf
else
echo -n "Do you want to remove this package anyway [y/N] ?"
read a;
if echo $a | grep -iq ^y; then
echo
echo "Ok, removing package, dont forget to remove the above mentioned"
echo "lines from /etc/apache-ssl/httpd.conf"
read a
else
exit 1
fi
fi
fi
fi
exit 0
|