postinst: default/authentic2 ne plantera plus si supann.conf est absent
This commit is contained in:
parent
5300c7bc02
commit
5a966c1cf2
38
postinst
38
postinst
|
@ -1,9 +1,37 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Postinst script for authentic2-supann
|
||||
#
|
||||
|
||||
if [ ! -f /etc/default/authentic2 ]; then
|
||||
echo '. /etc/authentic2/supann.conf' >/etc/default/authentic2
|
||||
elif ! grep -q supann.conf /etc/default/authentic2 2>/dev/null; then
|
||||
echo '. /etc/authentic2/supann.conf' >>/etc/default/authentic2
|
||||
add_supann_in_default() {
|
||||
cat << EODEFAULT >> /etc/default/authentic2
|
||||
if [ -x /etc/authentic2/supann.conf ]; then
|
||||
. /etc/authentic2/supann.conf
|
||||
fi
|
||||
EODEFAULT
|
||||
invoke-rc.d authentic2 restart
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
if [ ! -f /etc/default/authentic2 ]; then
|
||||
add_supann_in_default
|
||||
elif ! grep -q supann.conf /etc/default/authentic2 2> /dev/null; then
|
||||
add_supann_in_default
|
||||
fi
|
||||
;;
|
||||
reconfigure|abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
||||
invoke-rc.d authentic2 restart
|
||||
|
|
Reference in New Issue