summaryrefslogtreecommitdiff
path: root/debian/samba.preinst
blob: ae8cfaac9257a2b00aeb27bfbc8a207ed5629c0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
set -e

# Deactivate the old qtsmbstatusd initscript that has dependencies
# incompatible with the new samba initscript. This will allow to
# configure the new samba package and qtsmbstatus-server afterwards.
if [ "$1" = "upgrade" ] || [ "$1" = "install" ]; then
	if [ -x "/etc/init.d/qtsmbstatusd" ]; then
		version=$(dpkg-query -f '${Config-Version} ${Version}' -W qtsmbstatus-server 2>/dev/null | awk '{ print $1 }')
		if dpkg --compare-versions "$version" lt-nl "2.2.1-3~" ; then
			echo "Deactivating qtsmbstatusd temporarily..."
			invoke-rc.d qtsmbstatusd stop
			update-rc.d -f qtsmbstatusd remove
		fi
	fi
fi

#DEBHELPER#