diff --git a/scripts/upgrade b/scripts/upgrade index 46c9387..b05f0bb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -14,14 +14,18 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -if [ -z ${nss3_nick:-} ]; then - nss3_nick="" - ynh_app_setting_set --app=$app --key=nss3_nick --value="" -fi - -if [ -z ${nss3_password:-} ]; then +if ynh_compare_current_package_version --comparison lt --version 1.7.0~ynh2 +then + nss3_nick="SignaturePDF" + ynh_app_setting_set --app=$app --key=nss3_nick --value=$nss3_nick nss3_password=$(ynh_string_random) ynh_app_setting_set --app=$app --key=nss3_password --value=$nss3_password + + echo "# Digital signature configuration +NSS3_DIRECTORY=$data_dir/nss/ +NSS3_PASSWORD=$nss3_password +NSS3_NICK=$nss3_nick +" >> $install_dir/config/config.ini fi #================================================= @@ -29,7 +33,7 @@ fi #================================================= ynh_script_progression --message="Upgrading source files..." --weight=1 - # Download, check integrity, uncompress and patch the source from app.src +# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep="config/config.ini" chmod -R o-rwx "$install_dir"