#!/bin/bash # analog of %preun RPM scriptlet # For details see: # 1. https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#summary-of-ways-maintainer-scripts-are-called # 2. https://www.debian.org/doc/debian-policy/ap-flowcharts.html # Arguments in short: # "$1" == "upgrade" - DEB package manager will upgrade package # "$1" == "remove" - DEB package manager will remove package # "$1" == "failed-upgrade" - previous prerm upgrade was finished with error # "$2" == "package_version" - DEB package new version (only for upgrade/failed-upgrade command) # "lve-utils DEBIAN PRERM STARTED" rhel=8 solo_marker=/etc/cloudlinux-edition-solo container_marker=/etc/cloudlinux-container # NOTE: DEB Package Manager fails on any scriptlet error, so we mute them /usr/share/lve-utils/scriptlets/rpm_preun.sh "$1" $rhel $solo_marker $container_marker >/dev/null 2>&1 || true # Automatically added by dh_installinit/12.10ubuntu1 if [ -x "/etc/init.d/lve-utils" ]; then invoke-rc.d lve-utils stop || exit 1 fi # End automatically added section # "lve-utils DEBIAN PRERM FINISHED" exit 0