File: postinst

package info (click to toggle)
xdebconfigurator 1.35
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 328 kB
  • ctags: 42
  • sloc: perl: 982; makefile: 70; sh: 57
file content (29 lines) | stat: -rw-r--r-- 754 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

set -e

. /usr/share/debconf/confmodule

if [ -e /usr/share/xdebconfigurator/xdebc.db ]; then
   rm -f /usr/share/xdebconfigurator/xdebc.db;
fi

DEFAULTFILE=/etc/default/xdebconfigurator
ENABLE_ON_BOOT=false
# Update debconf based on the current value if it is set
if [ -f $DEFAULTFILE ] ; then
    . $DEFAULTFILE
    db_set xdebconfigurator/generate-at-boot "$ENABLE_ON_BOOT"
fi

db_get xdebconfigurator/generate-at-boot
if [ "$ENABLE_ON_BOOT" != "$RET" ] ; then
    if [ -f $DEFAULTFILE ] && grep -q "^ENABLE_ON_BOOT" $DEFAULTFILE ; then
	sed "s/^ENABLE_ON_BOOT=.+$/ENABLE_ON_BOOT=$RET/" < $DEFAULTFILE > \
	    $DEFAULTFILE.new && mv $DEFAULTFILE.new $DEFAULTFILE
    else
	echo "ENABLE_ON_BOOT=$RET" >> $DEFAULTFILE
    fi
fi

#DEBHELPER#