diff --git a/scripts/install b/scripts/install index 2f48a2a..b16ea01 100644 --- a/scripts/install +++ b/scripts/install @@ -140,9 +140,10 @@ tempdir="$(mktemp -d)" ynh_setup_source $tempdir $architecture if IS_PACKAGE_CHECK; then - dpkg -i $tempdir/$gitlab_filename || true # This command will fail in lxc env + if [ ! dpkg -i $tempdir/$gitlab_filename ]; then # This command will fail in lxc env ynh_replace_string "command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" "command \"cat \/etc\/sysctl.conf\"" "$final_path/embedded/cookbooks/package/resources/sysctl.rb" dpkg --configure gitlab-ce + fi else dpkg -i $tempdir/$gitlab_filename fi diff --git a/scripts/restore b/scripts/restore index 7d85dbd..27f9972 100644 --- a/scripts/restore +++ b/scripts/restore @@ -95,9 +95,10 @@ tempdir="$(mktemp -d)" ynh_setup_source $tempdir $architecture if IS_PACKAGE_CHECK; then - dpkg -i $tempdir/$gitlab_filename || true # This command will fail in lxc env + if [ ! dpkg -i $tempdir/$gitlab_filename ]; then # This command will fail in lxc env ynh_replace_string "command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" "command \"cat \/etc\/sysctl.conf\"" "$final_path/embedded/cookbooks/package/resources/sysctl.rb" dpkg --configure gitlab-ce + fi else dpkg -i $tempdir/$gitlab_filename fi diff --git a/scripts/upgrade b/scripts/upgrade index 880e33c..f58e7d8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -179,9 +179,10 @@ tempdir="$(mktemp -d)" ynh_setup_source $tempdir $architecture if IS_PACKAGE_CHECK; then - dpkg -i $tempdir/$gitlab_filename || true # This command will fail in lxc env + if [ ! dpkg -i $tempdir/$gitlab_filename ]; then # This command will fail in lxc env ynh_replace_string "command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" "command \"cat \/etc\/sysctl.conf\"" "$final_path/embedded/cookbooks/package/resources/sysctl.rb" dpkg --configure gitlab-ce + fi else dpkg -i $tempdir/$gitlab_filename fi