File: mgetty.postinst

package info (click to toggle)
mgetty 1.2.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,880 kB
  • sloc: ansic: 42,728; sh: 6,487; perl: 6,262; makefile: 1,457; tcl: 756; lisp: 283
file content (42 lines) | stat: -rw-r--r-- 914 bytes parent folder | download | duplicates (2)
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
#!/bin/sh -e

case "$1" in
    configure)
        # place the templates in /etc if they're not there ...
        for file in mgetty.config dialin.config login.config; do
	    if [ ! -f /etc/mgetty/$file ] ; then
	        cp -a /usr/share/mgetty/templates/etc/$file /etc/mgetty/$file;
	    fi;
	done

	# Remove old style of crontab insertion if present
	if grep -qs '^#-- mgetty begin$' /etc/crontab
	    then
	    TMP=/etc/crontab.tmp
	    awk 'BEGIN {found=0}
    /^#-- mgetty begin$/ {found = 1}
    /^#-- mgetty end$/ {found = -1}
    {if (!found) print}
    {if (found == -1) found=0}
    END {if (found) exit 1}' /etc/crontab >$TMP &&
	    if [ -s $TMP ]
		then
		mv -f $TMP /etc/crontab
	    fi
	fi

	if [ -f /etc/cron.daily/mgetty ]; then
		rm -f /etc/cron.daily/mgetty
	fi
	;;
    abort-upgrade|abort-remove|abort-deconfigure)
	;;
    *)
	;;
esac

chmod 0600 /etc/mgetty/login.config

#DEBHELPER#

exit 0;