From 52c685bc842bc5fc14c2634b99022c560f0a3ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 18:48:00 +0100 Subject: [PATCH] fix --- doc/POST_UPGRADE.md | 3 +++ scripts/upgrade | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 doc/POST_UPGRADE.md diff --git a/doc/POST_UPGRADE.md b/doc/POST_UPGRADE.md new file mode 100644 index 0000000..06a3064 --- /dev/null +++ b/doc/POST_UPGRADE.md @@ -0,0 +1,3 @@ +Your SMP server address: + +smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 256d212..4e4a699 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,6 +15,23 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# If public_ip4 doesn't exist, create it +if [ -z "$public_ip4" ]; then + public_ip4="$(curl -s ip.yunohost.org)" || true) + ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 +fi + +# If fingerprint doesn't exist, create it +if [ -z "$fingerprint" ]; then + fingerprint=$(cat /etc/opt/simplex/fingerprint) + ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint +fi + #================================================= # STANDARD UPGRADE STEPS #=================================================