diff --git a/scripts/_common.sh b/scripts/_common.sh index 2c37081..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,14 +7,7 @@ #================================================= # PERSONAL HELPERS #================================================= -IS_PACKAGE_CHECK () { - if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ] - then - return 0 - else - return 1 - fi -} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index b5f133c..6991e77 100755 --- a/scripts/install +++ b/scripts/install @@ -116,7 +116,7 @@ ynh_script_progression --message="Increasing maximum map count (sysctl)..." # Increase the maximum number of files inotify can monitor. cp -a ../conf/90-max_map_count-opensearch.conf /etc/sysctl.d/ # Then, reload the kernel configuration. -if ! IS_PACKAGE_CHECK # LXC doesn't allow sysctl to play with kernel options. +if ! [ "$container" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options. then sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf fi diff --git a/scripts/remove b/scripts/remove index 115d181..f662b19 100755 --- a/scripts/remove +++ b/scripts/remove @@ -113,7 +113,7 @@ ynh_script_progression --message="Removing various files..." if [ -e "/etc/sysctl.d/90-max_map_count-opensearch.conf" ]; then ynh_secure_remove --file="/etc/sysctl.d/90-max_map_count-opensearch.conf" # Reload the kernel configuration. - if ! IS_PACKAGE_CHECK # LXC doesn't allow sysctl to play with kernel options. + if ! [ "$container" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options. then sysctl --system fi diff --git a/scripts/restore b/scripts/restore index 9d07f2d..d2b60ce 100755 --- a/scripts/restore +++ b/scripts/restore @@ -91,7 +91,7 @@ chown $app:$app "/run/$app" ynh_script_progression --message="Restoring various files..." ynh_restore_file --origin_path="/etc/sysctl.d/90-max_map_count-opensearch.conf" -if ! IS_PACKAGE_CHECK # LXC doesn't allow sysctl to play with kernel options. +if ! [ "$container" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options. then sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf fi diff --git a/scripts/upgrade b/scripts/upgrade index cee2c90..f10ba30 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,7 +120,7 @@ ynh_script_progression --message="Increasing maximum map count (sysctl)..." # Increase the maximum number of files inotify can monitor. cp -a ../conf/90-max_map_count-opensearch.conf /etc/sysctl.d/ # Then, reload the kernel configuration. -if ! IS_PACKAGE_CHECK # LXC doesn't allow sysctl to play with kernel options. +if ! [ "$container" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options. then sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf fi