From 10cd9d4295cacad74e9aa78cb3ada93abd1993c8 Mon Sep 17 00:00:00 2001 From: Mayeul Cantan Date: Sun, 21 Apr 2024 18:08:20 +0200 Subject: [PATCH] Cleanup "common" variables only used for migration --- scripts/_common.sh | 4 ---- scripts/upgrade-pre-0.5.sh | 9 ++++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index a39c092..b8fe056 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,6 @@ # COMMON VARIABLES #================================================= -signald_data="/var/lib/signald" -signald_exe="/usr/bin/signald" -signald_user="signald" - enable_relaybot=true #================================================= diff --git a/scripts/upgrade-pre-0.5.sh b/scripts/upgrade-pre-0.5.sh index 6fcf1f9..95b2fef 100755 --- a/scripts/upgrade-pre-0.5.sh +++ b/scripts/upgrade-pre-0.5.sh @@ -12,11 +12,13 @@ # Version 0.5.1 of Mautrix Signal Bridge is written in Go, whereas previous versions # were written in Python. Also signald data is not needed anymore. -# Remove rustup -export PATH="$PATH:$install_dir/.cargo/bin:$install_dir/.local/bin:/usr/local/sbin" +signald_data="/var/lib/signald" +signald_exe="/usr/bin/signald" +signald_user="signald" +# Remove rustup if [ -e "$install_dir/.rustup" ]; then - ynh_exec_as "$app" env "PATH=$PATH" rustup self uninstall + ynh_exec_as "$app" "$install_dir/.cargo/bin/rustup" self uninstall fi # Remove signald executable @@ -25,6 +27,7 @@ ynh_secure_remove --file="$signald_exe" # Remove signald data ynh_secure_remove --file="$signald_data" + # Remove signald system user ynh_system_user_delete --username=$signald_user