#!/bin/bash # analog of %postun 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" == "remove" - remove package (The package’s files are removed (except conffiles)) # "$1" == "purge" - purge package (The package’s conffiles are removed) # "$1" == "abort-remove" - remove package error # "lvemanager DEBIAN POSTRM STARTED" #TODO: do not forget about this hack, improve hooks mechanism someday # unregister hook during downgrade # check also existence of old file, to exclude upgrade case and do not remove file during upgrade if [[ -e /usr/local/cpanel/scripts/nodejsunparkhook.py && -e /usr/local/cpanel/scripts/selectorunparkhook.py ]]; then /usr/local/cpanel/bin/manage_hooks delete script /scripts/selectorunparkhook.py \ --category=Whostmgr --event=Domain::unpark --stage=post --manual rm -f /usr/local/cpanel/scripts/selectorunparkhook.py rm -f /scripts/selectorunparkhook.py fi # "lvemanager DEBIAN POSTRM FINISHED" exit 0