#!/bin/sh # preinst script for lliurex-ssh-dgti # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in install) echo "*********************** PREINSTALL ************************************************" # Template for diversions ORIG_FILE="/etc/ssh/sshd_config" OUR_FILE="/etc/ssh/sshd_config.dgti" OUR_PACKAGE="lliurex-dgti-conf-sshd" if [ -f ${ORIG_FILE}.real ] ; then [ ! -L /etc/ssh/sshd_config ] || rm /etc/ssh/sshd_config dpkg-divert --package ${OUR_PACKAGE} --rename --quiet --remove ${ORIG_FILE}|| true fi ;; upgrade) ;; abort-upgrade) ;; *) echo "preinst 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