File: postrm

package info (click to toggle)
resolvconf 1.46
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 436 kB
  • ctags: 26
  • sloc: sh: 639; makefile: 33
file content (38 lines) | stat: -rwxr-xr-x 915 bytes parent folder | download
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
#!/bin/sh

set -e

#DEBHELPER#

case "$1" in
remove)
	# Restore /etc/resolv.conf
	if \
		[ -L /etc/resolv.conf ] \
		&& { \
			[ "$(readlink /etc/resolv.conf)" = "/etc/resolvconf/run/resolv.conf" ] \
			|| [ "$(readlink /etc/resolv.conf)" = "resolvconf/run/resolv.conf" ] ; \
		}
	then
		rm -f /etc/resolv.conf
		if [ -e /etc/resolvconf/run/resolv.conf ] ; then
			mv -f /etc/resolvconf/run/resolv.conf /etc/resolv.conf
		elif [ -e /etc/resolvconf/resolv.conf.d/original ] ; then
			mv -f /etc/resolvconf/resolv.conf.d/original /etc/resolv.conf
		fi
	fi
	;;
purge)
	if [ -L /etc/resolvconf/run ] ; then
		rm -f /etc/resolvconf/run
	elif [ -d /etc/resolvconf/run ] ; then
		rm -rf /etc/resolvconf/run
	fi
	rm -f /etc/resolvconf/resolv.conf.d/tail
	rm -f /etc/resolvconf/resolv.conf.d/original
	rm -f /etc/default/resolvconf
	rmdir /lib/init/rw/resolvconf/interface || :
	rmdir /lib/init/rw/resolvconf || :
	;;
esac