File: postinst

package info (click to toggle)
fdutils 5.6-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,540 kB
  • sloc: ansic: 6,334; sh: 3,570; makefile: 262; sed: 4
file content (47 lines) | stat: -rw-r--r-- 1,298 bytes parent folder | download | duplicates (6)
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
#!/bin/sh
set -e

. /usr/share/debconf/confmodule

#DEBHELPER#

case "$1" in
    configure)

	if [ -e /etc/fdmount.conf ]; then
	    TMPFILE="$(mktemp -q /tmp/fdmount.conf.tmp.XXXXXX)"
	    db_get fdutils/fdmount_setuid
	    if [ "$RET" = true ] \
		&& grep -q '^is_suid=n.*' /etc/fdmount.conf; then
		sed -e 's/^is_suid=.*$/is_suid=yes/' </etc/fdmount.conf >>"$TMPFILE"
		chmod 644 "$TMPFILE"
		mv "$TMPFILE" /etc/fdmount.conf
		dpkg-statoverride --update --add root floppy 4750 /usr/bin/fdmount
	    elif [ "$RET" = false ] \
		&& grep -q '^is_suid=y.*' /etc/fdmount.conf; then
		sed -e 's/^is_suid=.*$/is_suid=no/' </etc/fdmount.conf >>"$TMPFILE"
		chmod 644 "$TMPFILE"
		mv "$TMPFILE" /etc/fdmount.conf
		chmod u-s /usr/bin/fdmount
		dpkg-statoverride --remove /usr/bin/fdmount
	    fi
	    if [ -e "$TMPFILE" ]; then
		rm -f "$TMPFILE"
	    fi
	fi

	if [ -e "/etc/fdprm" ]; then
	    echo "Fdutils-5.0 introduced two new configuration files: /etc/mediaprm and" >&2
	    echo "/etc/driveprm.  They replace the old /etc/fdprm." >&2
	    echo "Renaming old file /etc/fdprm to /etc/fdprm.obsolete ..." >&2
	    mv -f /etc/fdprm /etc/fdprm.obsolete
	    echo >&2
	fi
	;;

    abort-upgrade|abort-remove|abort-deconfigure)
	;;
    *)
	echo "postinst called with unknown argument \`$1'" >&2
	;;
esac