#!/bin/bash # analog of %post/%posttrans 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" == "configure" - RPM post/posttrans # "$1" == "abort-upgrade" - upgrade package error # "$1" == "abort-remove" - remove package error # "$1" == "triggered" - trigger, "$2" - observed file which fired the trigger # RPM post Arguments: # $1 - python binary path - /opt/cloudlinux/venv/bin/python3 # $2 - CL Solo marker - /etc/cloudlinux-edition-solo # "lvemanager DEBIAN POSTINST STARTED" python_bin='/opt/cloudlinux/venv/bin/python3' solo_marker='/etc/cloudlinux-edition-solo' container_marker='/etc/cloudlinux-container' case "$1" in configure) # RPM post /usr/share/l.v.e-manager/scriptlets/rpm_post.sh "$1" "$python_bin" "$solo_marker" "$container_marker" # RPM posttrans /usr/share/l.v.e-manager/scriptlets/rpm_posttrans.sh "$1" ;; triggered) echo "******triggered called with $2" # triggerd by installing alt-nodejs-nodejs package echo "$2" | grep -qE "/opt/alt/alt-nodejs[0-9]+/root/usr/bin/node" && /usr/share/l.v.e-manager/scriptlets/rpm_trigger_nodejs.sh ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument: $1" >&2 exit 1 ;; esac # "lvemanager DEBIAN POSTINST FINISHED" exit 0