This file is indexed.

postrm is in di-netboot-assistant 0.36b.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
#!/bin/sh
# postrm script for di-netboot-assistant

set -e

#This function should be kept in sync with function "purge_repo" in di-netboot-assistant
purge_repo() {
	dist="$1"
	metadatabasename="$(echo $dist | sed -e 's/\.conf$//' )"

	tarfile="$(grep -E "^[[:blank:]]*dl_file=" "$dist" | sed -e 's/^[[:blank:]]*dl_file=//')"
	[ -f "$tarfile" ] && rm "$tarfile"

	expand_dir="$(grep -E "^[[:blank:]]*expand_dir=" "$dist" | sed -e 's/^[[:blank:]]*expand_dir=//')"
	[ "$expand_dir" != "/" -a -d "$expand_dir" ] && rm -Rf "$expand_dir"

	dist_dir="$(echo  "$expand_dir" | sed -e 's,/[^/]\+$,,')"
	rmdir --ignore-fail-on-non-empty "$dist_dir"

	di_dir="$(echo  "$dist_dir" | sed -e 's,/[^/]\+$,,')"
	[ -f "$di_dir/pxelinux.cfg/default" ] && grep -q "## DO NOT EDIT THIS FILE" "$di_dir/pxelinux.cfg/default" && rm "$di_dir/pxelinux.cfg/default"
	[ -f "$di_dir/pxelinux.cfg/default.serial-9600" ] && grep -q "## DO NOT EDIT THIS FILE" "$di_dir/pxelinux.cfg/default.serial-9600" && rm "$di_dir/pxelinux.cfg/default.serial-9600"
	[ -f "$di_dir/elilo.conf" ] && grep -q "## DO NOT EDIT THIS FILE" "$di_dir/elilo.conf" && rm "$di_dir/elilo.conf"

	[ ! -e "$di_dir/pxelinux.cfg/default" -a ! -e "$di_dir/pxelinux.cfg/default.serial-9600" -a -f "$di_dir/pxelinux.cfg/$SYSLINUXMENU" ] && rm "$di_dir/pxelinux.cfg/$SYSLINUXMENU"
	[ -d "$di_dir/pxelinux.cfg" ] && rmdir --ignore-fail-on-non-empty "$di_dir/pxelinux.cfg"
	[ ! -e "$di_dir/pxelinux.cfg" -a -f "$di_dir/pxelinux.0" ] && rm "$di_dir/pxelinux.0"		
	rmdir --ignore-fail-on-non-empty "$di_dir"
	[ ! -e "$di_dir/elilo.conf" -a -f "$di_dir/elilo.efi" ] && rm "$di_dir/elilo.efi"

	pxemenufragment="$metadatabasename.pxelinux.menu.fragment"
	[ -f "$pxemenufragment" ] && rm "$pxemenufragment"

	pxemenufragment_serial9600="$metadatabasename.pxelinux.menu.serial-9600.fragment"
	[ -f "$pxemenufragment_serial9600" ] && rm "$pxemenufragment_serial9600"

	elilomenufragment="$metadatabasename.elilo.conf.fragment"
	[ -f "$elilomenufragment" ] && rm "$elilomenufragment"

	rm "$dist"
}


case "$1" in
    purge)
    	if [ -d /var/lib/di-netboot-assistant ]; then

		[ -z "$SYSLINUXMENU" ] && SYSLINUXMENU=menu.c32
		for x in $( find /var/lib/di-netboot-assistant -type f -name '*.conf' ) ; do
			purge_repo "$x"
		done
	fi
    ;;
    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;

    *)
	echo "postrm called with unknown argument \`$1'" >&2
	exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.



exit 0