Reportsquid3postinst

Status: Accepted

Colis script


begin
  true ;
  if (test [ '-d'; '/etc/squid3' ] &&
       dpkg [ '--compare-versions'; arg 2; 'lt'; '3.5' ])
  then begin
         if test [ '-x'; '/etc/init.d/squid3' ]
         then begin
                invoke-rc.d [ 'squid3'; 'stop' ] ;
                nooutput update-rc.d [ 'squid3'; 'remove' ]
           end
         fi ;
         if [ [ arg 1; '='; 'configure'; ']' ]
         then invoke-rc.d [ 'squid'; 'reload' ] fi
    end
  fi ;
  case_1715476 := arg 1 ;
  (((test [ case_1715476; '='; 'abort-upgrade' ] ||
      test [ case_1715476; '='; 'abort-remove' ]) ||
     test [ case_1715476; '='; 'abort-deconfigure' ]) ||
    exit success) ;
  dpkg-maintscript-helper [ 'rm_conffile'; '/etc/squid3/msntauth.conf';
                          '3.5.4-1\~'; 'squid3'; '--'; 'DUM'; 'MY' ] ;
  dpkg-maintscript-helper [ 'mv_conffile'; '/etc/squid3/squid.conf';
                          '/etc/squid/squid.conf'; '3.5.4-1\~'; 'squid3';
                          '--'; 'DUM'; 'MY' ] ;
  dpkg-maintscript-helper [ 'mv_conffile'; '/etc/squid3/errorpage.css';
                          '/etc/squid/errorpage.css'; '3.5.4-1\~'; 'squid3';
                          '--'; 'DUM'; 'MY' ] ;
  exit success
end

Original Shell script

#! /bin/sh

set -e

#
# If the squid3 package was being used previously...
#
if test -d /etc/squid3 && dpkg --compare-versions "$2" lt '3.5'; then
	#
	# Stop squid3 daemon and remove init script links
	#
	if test -x /etc/init.d/squid3 ; then
		invoke-rc.d squid3 stop
		update-rc.d squid3 remove >/dev/null
	fi
	if [ "$1" = "configure" ] ; then
		invoke-rc.d squid reload
	fi
fi

case "$1" in
	abort-upgrade|abort-remove|abort-deconfigure)
		;;
	*)
		#
		#	Unknown action - do nothing.
		#
		exit 0
		;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

# Automatically added by dh_installdeb/12.1.1
dpkg-maintscript-helper rm_conffile /etc/squid3/msntauth.conf 3.5.4-1\~ squid3 -- "$@"
dpkg-maintscript-helper mv_conffile /etc/squid3/squid.conf /etc/squid/squid.conf 3.5.4-1\~ squid3 -- "$@"
dpkg-maintscript-helper mv_conffile /etc/squid3/errorpage.css /etc/squid/errorpage.css 3.5.4-1\~ squid3 -- "$@"
# End automatically added section


exit 0