#!/bin/bash # postinst script for cpanel-plugin-components # # see: dh_installdeb(1) set -e # Begin vars.sh #!/bin/bash # DO NOT EDIT # This file is regenerated each run. # If you want to add or change a variable, edit debify/settings.json and the vars hashref source /etc/os-release export OBS_REPO="x${NAME}_${VERSION_ID}" if ls debian/*.install &> /dev/null; then perl -pi -e 's/\${env:OBS_REPO}/$ENV{OBS_REPO}/' debian/*.install fi export DEB_INSTALL_ROOT="/usr/src/packages/BUILD/debian/tmp" export DEB_SOURCE_ROOT="/usr/src/packages/BUILD/debian/SOURCES_FROM_SPEC" export RPM_SOURCE_DIR="/usr/src/packages/BUILD/debian/SOURCES_FROM_SPEC" export __isa_bits="64" export __isa_name="x86" export __sourcedir="" export _bindir="/opt/cpanel//root/usr/bin" export _cpanel_plugins="/var/cpanel/plugins" export _datadir="/opt/cpanel//root/usr/share" export _defaultdocdir="/opt/cpanel//root/usr/share/doc" export _docdir="/opt/cpanel//root/usr/share/doc" export _exec_prefix="/opt/cpanel//root/usr" export _includedir="/opt/cpanel//root/usr/include" export _infodir="/opt/cpanel//root/usr/share/info" export _isa="" export _lib="lib64" export _libdir="/opt/cpanel//root/usr/lib64" export _libexecdir="/opt/cpanel//root/usr/libexec" export _localstatedir="/opt/cpanel//root/var" export _mandir="/opt/cpanel//root/usr/share/man" export _prefix="/opt/cpanel//root/usr" export _root_bindir="/opt/cpanel//root/usr/bin" export _root_datadir="/opt/cpanel//root/usr/share" export _root_exec_prefix="/opt/cpanel//root/usr" export _root_includedir="/opt/cpanel//root/usr/include" export _root_infodir="/opt/cpanel//root/usr/share/info" export _root_initddir="/opt/cpanel//root/etc/rc.d/init.d" export _root_libdir="/opt/cpanel//root/usr/lib64" export _root_libexecdir="/opt/cpanel//root/usr/libexec" export _root_localstatedir="/opt/cpanel//root/var" export _root_mandir="/opt/cpanel//root/usr/share/man" export _root_prefix="/opt/cpanel//root/usr" export _root_sbindir="/opt/cpanel//root/usr/sbin" export _root_sharedstatedir="/opt/cpanel//root/usr/com" export _root_sysconfdir="/opt/cpanel//root/etc" export _sbindir="/opt/cpanel//root/usr/sbin" export _scl_prefix="/opt/cpanel" export _scl_root="/opt/cpanel//root" export _sysconfdir="/opt/cpanel//root/etc" export _ulc="/usr/local/cpanel" export _unitdir="/usr/lib/systemd/system" export buildroot="/usr/src/packages/BUILD/debian/tmp" export config_docs_url="https://cpanel.net # TODO" export full_package_name="cpanel-plugin-components-1.5.0" export ix86="i386" export name="cpanel-plugin-components" export nil="0" export ns_name="ea" export pkg="" export pkg_name="" export pkgname="" export previous_version="1.4.8" export release="2" export release_prefix="2" export scl="" export scl_name="" export scl_name_base="" export scl_name_version="" export scl_prefix="" export version="1.5.0" export version_with_debian_revision="1.5.0-2" export SOURCE0="$DEB_SOURCE_ROOT/LICENSE" export SOURCE1="$DEB_SOURCE_ROOT/pkg.postinst" export SOURCE2="$DEB_SOURCE_ROOT/pkg.postrm" export SOURCE3="$DEB_SOURCE_ROOT/pkg.preinst" export SOURCE4="$DEB_SOURCE_ROOT/pkg.prerm" export SOURCE5="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components.pm" export SOURCE6="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Base.pm" export SOURCE7="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_JSON.pm" export SOURCE8="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Role_CampaignV1.pm" export SOURCE9="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Role_CampaignV2.pm" export SOURCE10="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Role_Cpanel_Template.pm" export SOURCE11="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Role_Template.pm" export SOURCE12="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules.pm" export SOURCE13="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_And.pm" export SOURCE14="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Base.pm" export SOURCE15="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_CompanyId.pm" export SOURCE16="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_CompareVersion.pm" export SOURCE17="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_CpanelVersion.pm" export SOURCE18="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_DateRange.pm" export SOURCE19="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Distributions.pm" export SOURCE20="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_DnsOnly.pm" export SOURCE21="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_False.pm" export SOURCE22="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_FeatureEnabled.pm" export SOURCE23="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_FeatureFlag.pm" export SOURCE24="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Filter.pm" export SOURCE25="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_IsBeta.pm" export SOURCE26="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Not.pm" export SOURCE27="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Operator.pm" export SOURCE28="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Or.pm" export SOURCE29="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Personalization.pm" export SOURCE30="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_PluginEnabled.pm" export SOURCE31="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Random.pm" export SOURCE32="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Random_Class_Development_Wiki.md" export SOURCE33="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Random_Dependency_Diagram.mm" export SOURCE34="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Random_Internal_Sequence_Diagram.mm" export SOURCE35="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Tiers.pm" export SOURCE36="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_True.pm" export SOURCE37="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Util_Filter.pm" export SOURCE38="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Util_FindStartDate.pm" export SOURCE39="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Util_NVData.pm" export SOURCE40="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Util_Normalize.pm" export SOURCE41="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Rules_Class_Heirarchy_Diagram.mm" export SOURCE42="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_Whostmgr.pm" export SOURCE43="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_YAML.pm" export SOURCE44="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_Components_whostmgr_home_homebanner.pm" export SOURCE45="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Plugins_State.pm" export SOURCE46="$DEB_SOURCE_ROOT/_usr_local_cpanel_Cpanel_Template_Plugin_Components.pm" export SOURCE47="$DEB_SOURCE_ROOT/_usr_local_cpanel_base_frontend_jupiter__assets_component.html.tt" export SOURCE48="$DEB_SOURCE_ROOT/_usr_local_cpanel_base_webmail_jupiter__assets_component.html.tt" export SOURCE49="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_integration_Cpanel-Plugins-Components-Rules-Random-Integration.t" export SOURCE50="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_integration_Cpanel-Plugins-Components-Rules-TrueFalse-Integration.t" export SOURCE51="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_large_Cpanel-Plugins-Components-Rules-Random-boundary-conditions.t" export SOURCE52="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_large_Cpanel-Plugins-Components-Rules-Random-fleet-simulation.t" export SOURCE53="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_large_Cpanel-Plugins-Components-Rules-Random-randomness-quality.t" export SOURCE54="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_large_Cpanel-Plugins-Components-Rules-Random-statistical-distribution.t" export SOURCE55="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_large_Cpanel-Plugins-Components.t" export SOURCE56="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Base.t" export SOURCE57="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-JSON.t" export SOURCE58="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-And.t" export SOURCE59="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Base.t" export SOURCE60="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-CompanyId.t" export SOURCE61="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-CompareVersion.t" export SOURCE62="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-CpanelVersion.t" export SOURCE63="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-DateRange.t" export SOURCE64="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Distributions.t" export SOURCE65="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-DnsOnly.t" export SOURCE66="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-False.t" export SOURCE67="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-FeatureEnabled.t" export SOURCE68="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-FeatureFlag.t" export SOURCE69="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Filter.t" export SOURCE70="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-IsBeta.t" export SOURCE71="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Not.t" export SOURCE72="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Or.t" export SOURCE73="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Personalization.t" export SOURCE74="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-PluginEnabled.t" export SOURCE75="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Random.t" export SOURCE76="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Tiers.t" export SOURCE77="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-True.t" export SOURCE78="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Util-Filter.t" export SOURCE79="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Util-FindStartDate.t" export SOURCE80="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules-Util-NVData.t" export SOURCE81="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-Rules.t" export SOURCE82="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components-YAML.t" export SOURCE83="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-Components.t" export SOURCE84="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Plugins-State.t" export SOURCE85="$DEB_SOURCE_ROOT/_usr_local_cpanel_t_medium_Cpanel-Template-Plugin-Components.t" export SOURCE86="$DEB_SOURCE_ROOT/_usr_local_cpanel_whostmgr_docroot_images_components-error-warning-line.svg" export SOURCE87="$DEB_SOURCE_ROOT/_usr_local_cpanel_whostmgr_docroot_templates_components_banner.tmpl" export SOURCE88="$DEB_SOURCE_ROOT/_usr_local_cpanel_whostmgr_docroot_templates_components_warning-banner.min.js" export SOURCE89="$DEB_SOURCE_ROOT/_usr_local_cpanel_whostmgr_docroot_templates_components_warning-banner.min.js.map" export SOURCE90="$DEB_SOURCE_ROOT/_usr_local_cpanel_whostmgr_docroot_templates_master_templates_component.html.tt" export SOURCE91="$DEB_SOURCE_ROOT/_var_cpanel_plugins_components_README.md" export SOURCE92="$DEB_SOURCE_ROOT/_var_cpanel_plugins_components_homebanner.json" export SOURCE93="$DEB_SOURCE_ROOT/_var_cpanel_plugins_components_locale_de.yaml" # End vars.sh # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # Contents of SOURCES/pkg.postinst #!/bin/bash PLUGIN_DIR=/var/cpanel/plugins/components DEFAULT_THEME=jupiter TOUCH=`which touch` LOCALE_DIR='/var/cpanel/locale' THEME_DIR="/var/cpanel/locale/themes/${DEFAULT_THEME}" # First Install if [[ "$1" == "1" || "$1" == "abort-upgrade" ]]; then # Must be updated to force a rebuild of the locale databases in case there are any changes. # * cdb files are not tracked by the OS package. # * yaml files are tracked by OS package, so any change will show as a package update. # * In order to rebuild, the yaml files must show as newer than cdb files. # So, first, set an old date (1970...) for the cdb files, and build_locale_databases --clean will reset them after the critical comparison happens. find $PLUGIN_DIR/locale/ -type f -name "*.yaml" -exec basename {} .yaml \; | xargs -I % $TOUCH -d '1970-12-12' $LOCALE_DIR/%.cdb $THEME_DIR/%.cdb # NOTE: --clean removes the cdb file first and then regenerates it. /usr/local/cpanel/bin/servers_queue queue 'build_locale_databases --clean' || true fi # Upgrades if [[ "$1" == "2" || "$1" == "configure" ]]; then # Must be updated to force a rebuild of the locale databases in case there are any changes. # * cdb files are not tracked by the OS package. # * yaml files are tracked by OS package, so any change will show as a package update. # * In order to rebuild, the yaml files must show as newer than cdb files. # So, first, set an old date (1970...) for the cdb files, and build_locale_databases --clean will reset them after the critical comparison happens. find $PLUGIN_DIR/locale/ -type f -name "*.yaml" -exec basename {} .yaml \; | xargs -I % $TOUCH -d '1970-12-12' $LOCALE_DIR/%.cdb $THEME_DIR/%.cdb # NOTE: --clean removes the cdb file first and then regenerates it. /usr/local/cpanel/bin/servers_queue queue 'build_locale_databases --clean' || true fi # End SOURCES/pkg.postinst exit 0