#!/bin/sh set -e test $DEBIAN_SCRIPT_DEBUG && set -v -x GENCONF="/etc/snort/snort.conf" # generic configuration file DBCONF="/etc/snort/database.conf" # deprecated # versions previous to 2.9.3 created the /etc/snort/database.conf # file for configuration #if dpkg --compare-versions "$2" le "2.9.3" && [ -e "$DBCONF" ] && ! [ -s "$DBCONF" ] #then # # should show a warning to the user if not empty? # (it will be deprecated anyway and will not be included in snort.conf) # #fi # Remove the database configuration file it is exists and is empty if [ -e "$DBCONF" ] && ! [ -s "$DBCONF" ] then if dpkg-maintscript-helper supports rm_conffile; then dpkg-maintscript-helper rm_conffile $DBCONF 2.9.3~ snort-common -- "$@" else if [ "$1" = "upgrade" ]; then rm -f $DBCONF fi fi fi # rename probably existing cron job with old name # try first to use dpkg-maintscript-helper if dpkg-maintscript-helper supports mv_conffile; then dpkg-maintscript-helper mv_conffile /etc/cron.daily/5snort /etc/cron.daily/snort-common 2.9.15.1-5~ snort-common -- "$@" dpkg-maintscript-helper mv_conffile /etc/cron.daily/snort-common /etc/cron.daily/0snort-common 2.9.15.1-6~ snort-common -- "$@" else # Manually move the file, this will generate a dpkg prompt to # approve the changes if [ -e /etc/cron.daily/5snort ]; then if [ "$1" = "upgrade" ]; then mv /etc/cron.daily/5snort /etc/cron.daily/snort-common fi fi if [ -e /etc/cron.daily/snort-common ]; then if [ "$1" = "upgrade" ]; then mv /etc/cron.daily/snort-common /etc/cron.daily/0snort-common fi fi fi # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. exit 0