From 395706f048f155c40e7ab87921565131183087a2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 Jan 2020 00:42:40 +0100 Subject: [PATCH] several fixes --- scripts/backup | 5 +---- scripts/change_url | 5 +---- scripts/install | 14 +++++--------- scripts/restore | 5 +---- scripts/upgrade | 13 +++++-------- 5 files changed, 13 insertions(+), 29 deletions(-) diff --git a/scripts/backup b/scripts/backup index a804c08..979b2a6 100644 --- a/scripts/backup +++ b/scripts/backup @@ -83,10 +83,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" -if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 1 ]; then - sleep 60 -fi +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" --length=100 #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 2b2dc97..eff7469 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -118,10 +118,7 @@ fi #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" -if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 1 ]; then - sleep 60 -fi +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" --length=100 #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 160eb0c..e18e24c 100644 --- a/scripts/install +++ b/scripts/install @@ -121,16 +121,16 @@ ynh_print_info --message="Making install..." chown -R "$app":"$app" "$final_path" # Install rustup with the toolchain needed by bitwarden_rs -pushd "$final_path" || exit +pushd "$final_path" sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=$(cat build/rust-toolchain)' -popd || exit +popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" # Compile bitwarden_rs -pushd "$final_path"/build || exit +pushd "$final_path"/build sudo -u "$app" env PATH="$PATH" cargo build --features sqlite --release -popd || exit +popd # Install bitwarden_rs cp -a "$final_path"/build/target/release/. "$final_path"/live/. @@ -204,11 +204,7 @@ yunohost service add $app --description "$app daemon for Bitwarden" --log "/var/ ynh_print_info --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" -if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 1 ]; then - ynh_systemd_action --service_name="$app" --action="restart" --log_path="systemd" --line_match="Rocket has launched from" - sleep 60 -fi +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" --length=100 #================================================= # SETUP FAIL2BAN diff --git a/scripts/restore b/scripts/restore index 4c314bb..d60119c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -120,10 +120,7 @@ yunohost service add $app --description "$app daemon for Bitwarden" --log "/var/ ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" -if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 1 ]; then - sleep 60 -fi +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" --length=100 #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index c494d6a..b19f400 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -128,16 +128,16 @@ chown -R "$app":"$app" "$final_path" if [ "$upgrade_type" == "UPGRADE_APP" ] then # Install rustup with the toolchain needed by bitwarden_rs - pushd "$final_path" || exit + pushd "$final_path" sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=$(cat build/rust-toolchain)' - popd || exit + popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" # Compile bitwarden_rs - pushd "$final_path"/build || exit + pushd "$final_path"/build sudo -u "$app" env PATH="$PATH" cargo build --features sqlite --release - popd || exit + popd # Install bitwarden_rs cp -a "$final_path"/build/target/release/. "$final_path"/live/. @@ -226,10 +226,7 @@ fi #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" -if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 1 ]; then - sleep 60 -fi +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Rocket has launched from" --length=100 #================================================= # RELOAD NGINX