#!/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 # "cloudlinux-linksafe DEBIAN POSTRM STARTED" solo_marker='/etc/cloudlinux-edition-solo' container_marker='/etc/cloudlinux-container' if [ -f "$solo_marker" ] || [ -f "$container_marker" ]; then exit 0 fi if [[ "$1" == "remove" ]]; then if getent group linksafe >/dev/null; then groupdel linksafe fi rm -f /etc/sysctl.d/cloudlinux-linksafe.conf for option in protected_symlinks_create protected_hardlinks_create protected_symlinks_allow_gid protected_hardlinks_allow_gid; do if [ -e "/proc/sys/fs/$option" ]; then echo 0 > "/proc/sys/fs/$option" fi done fi # "cloudlinux-linksafe DEBIAN POSTRM FINISHED" exit 0