Remove code to unmangle inittab from postrm
[grml-etc.git] / debian / postrm
1 #!/bin/sh
2 # Filename:      postrm
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 ################################################################################
8
9 set -e
10
11 TO_UNDIVERT1="ssh"
12
13 undivert_gen() {
14     DEXT=${3:-original}
15     dpkg-divert --remove --rename --package grml-etc \
16         --divert $2/$1.$DEXT $2/$1 #> /dev/null
17 }
18
19 case "$1" in
20     purge)
21         for cmd in $TO_UNDIVERT1; do
22                 undivert_gen $cmd /etc/init.d
23         done
24
25         # make sure the ssh init script even exists if something is failing...
26         if ls /etc/init.d/ssh* 1>/dev/null 2>&1 ; then
27           if [ ! -f /etc/init.d/ssh -a /etc/init.d/ssh.original.dpkg-new ] ; then
28              mv /etc/init.d/ssh.original.dpkg-new /etc/init.d/ssh
29           fi
30         fi
31
32      ;;
33
34    remove|abort-install|disappear)
35      ;;
36
37    upgrade|failed-upgrade|abort-install|abort-upgrade)
38      ;;
39
40     *)
41       echo "postrm called with unknown argument $1" >&2
42       exit 1
43 esac
44
45 #DEBHELPER#
46
47 exit 0
48
49 ## END OF FILE #################################################################