From 556fefd525ad1e3e6a2187b4b5631e3766f55579 Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 31 Jul 2019 17:49:20 +0200 Subject: [PATCH] Fix package_check_action --- scripts/upgrade.d/upgrade.last.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index edb5df3..87fd245 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -8,5 +8,9 @@ gitlab_filename="gitlab-ce-${gitlab_version}.deb" # Action to do in case of failure of the package_check package_check_action() { - ynh_replace_string --match_string="command \"sysctl -e --system\"" --replace_string="command \"sysctl -e --system || true\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb" + local sysctl_file="$final_path/embedded/cookbooks/package/resources/gitlab_sysctl.rb" + if [ ! -f "$sysctl_file" ]; then + sysctl_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb" + fi + ynh_replace_string --match_string="command \"sysctl -e --system\"" --replace_string="command \"sysctl -e --system || true\"" --target_file=$sysctl_file }