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;
|