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

Last change on this file since 5167 was 5167, checked in by daduve, 4 years ago

Adding diversion for cupsd.conf

File size: 763 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                systemctl stop cups || true
15                dpkg-divert --add --package ${PKG} --rename --divert "$NEW_DIVERTED_FILE" "$ORIGINAL_FILE"
16                ln -s "$LLIUREX_FILE" "$ORIGINAL_FILE"
17                systemctl start cups || true
18
19        fi
20       
21        n4d-modules enable-plugin /etc/n4d/conf.d/CupsManager || true
22        ;;
23   upgrade)
24        n4d-modules enable-plugin /etc/n4d/conf.d/CupsManager || true
25        ;;
26   abort-upgrade|abort-remove|abort-deconfigure)
27        ;;
28  *)
29    echo "postinst called with unknown argument \`$1'" >&2
30    exit 1
31  ;;
32esac
33
34#DEBHELPER#
35
36exit 0
Note: See TracBrowser for help on using the repository browser.