source: n4d-cups/trunk/fuentes/debian/n4d-cups.postinst

Last change on this file was 5171, checked in by hectorgh, 4 years ago

restart instead of stop/start

File size: 735 bytes
Line 
1#!/bin/sh
2
3set -e
4
5case "$1" in
6   configure)
7        PKG="n4d-cups"
8        ORIGINAL_FILE="/etc/cups/cupsd.conf"
9        NEW_DIVERTED_FILE="/etc/cups/cupsd.conf.diverted"
10        LLIUREX_FILE="/etc/cups/cupsd.conf.lliurex"
11       
12        if [ ! -L "$ORIGINAL_FILE" ]; then
13
14                dpkg-divert --add --package ${PKG} --rename --divert "$NEW_DIVERTED_FILE" "$ORIGINAL_FILE"
15                ln -s "$LLIUREX_FILE" "$ORIGINAL_FILE"
16                systemctl restart cups || true
17
18        fi
19       
20        n4d-modules enable-plugin /etc/n4d/conf.d/CupsManager || true
21        ;;
22   upgrade)
23        n4d-modules enable-plugin /etc/n4d/conf.d/CupsManager || true
24        ;;
25   abort-upgrade|abort-remove|abort-deconfigure)
26        ;;
27  *)
28    echo "postinst called with unknown argument \`$1'" >&2
29    exit 1
30  ;;
31esac
32
33#DEBHELPER#
34
35exit 0
Note: See TracBrowser for help on using the repository browser.