3 # Purpose: postrm script for package grml-etc
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
11 TO_UNDIVERT1="login.config mgetty.config"
13 TO_UNDIVERT3="kismet.conf"
14 TO_UNDIVERT4="wlan-ng.conf"
15 TO_UNDIVERT5="smb.conf"
19 dpkg-divert --remove --rename --package grml-etc \
20 --divert $2/$1.$DEXT $2/$1 #> /dev/null
23 replace_grml_with_orig_inittab() {
24 if grep -q '^l0:0:wait:/etc/init.d/grml-halt$' /etc/inittab ; then
25 sed -i 's|^l0:0:wait:/etc/init.d/grml-halt|l0:0:wait:/etc/init.d/rc 0|' /etc/inittab
28 if grep -q '^l6:6:wait:/etc/init.d/grml-reboot$' /etc/inittab ; then
29 sed -i 's|^l6:6:wait:/etc/init.d/grml-reboot|l6:6:wait:/etc/init.d/rc 6|' /etc/inittab
35 for cmd in $TO_UNDIVERT1; do
36 undivert_gen $cmd /etc/mgetty
38 for cmd in $TO_UNDIVERT2; do
39 undivert_gen $cmd /etc/init.d
41 for cmd in $TO_UNDIVERT3; do
42 undivert_gen $cmd /etc/kismet
44 for cmd in $TO_UNDIVERT4; do
45 undivert_gen $cmd /etc/pcmcia
47 for cmd in $TO_UNDIVERT5; do
48 undivert_gen $cmd /etc/samba
51 # make sure the ssh init script even exists if something is failing...
52 if ls /etc/init.d/ssh* 1>/dev/null 2>&1 ; then
53 if [ ! -f /etc/init.d/ssh -a /etc/init.d/ssh.original.dpkg-new ] ; then
54 mv /etc/init.d/ssh.original.dpkg-new /etc/init.d/ssh
58 replace_grml_with_orig_inittab
61 remove|abort-install|disappear)
62 replace_grml_with_orig_inittab
65 upgrade|failed-upgrade|abort-install|abort-upgrade)
69 echo "postrm called with unknown argument $1" >&2
75 ## END OF FILE #################################################################