diff --git a/README.md b/README.md
index c00f297..d1e2636 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
[Friendica](http://friendi.ca/) integration for YunoHost
-**Version:2018.05**
+**Version:2018.09**
Current snapshot in *sources*:
diff --git a/conf/addon.ini.php b/conf/addon.ini.php
new file mode 100644
index 0000000..d091659
--- /dev/null
+++ b/conf/addon.ini.php
@@ -0,0 +1,33 @@
+> $final_path/.htconfig.php"
+sudo cp "../conf/addon.ini.php" "$final_path/config/."
#=================================================
# CREATE DEDICATED USER
diff --git a/scripts/upgrade b/scripts/upgrade
index 815b32d..ff9dd50 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -39,10 +39,19 @@ ynh_install_app_dependencies 'php-mbstring|base-files(<<9.0)' php5-cli 'php5-ima
# Create a temporary directory
tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir
-cp -a "$final_path/.htconfig.php" "$tmpdir/.htconfig.php"
-if [ -f $final_path/.htaccess ]; then
- cp -a "$final_path/.htaccess" "$tmpdir/.htaccess"
+cp -af "$final_path/.htaccess" "$tmpdir/.htaccess"
+cp -af "$final_path/view/smarty3" "$tmpdir/view/smarty3"
+if [ -f $final_path/.htconfig.php ]; then
+ rm "$final_path/.htconfig.php"
+ cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php"
+ ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/config/local.ini.php"
+ ynh_replace_string "mysqlusername" "$db_name" "$final_path/config/local.ini.php"
+ ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/config/local.ini.php"
+ ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path/config/local.ini.php"
+ ynh_replace_string "admin_email =" "admin_email = $admin_mail" "$final_path/config/local.ini.php"
+ ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER_CLOSED" "$final_path/config/local.ini.php"
fi
+cp -af "$final_path/config/local.ini.php" "$tmpdir/config/local.ini.php"
rm -Rf "$final_path"
# If final_path doesn't exist, create it
@@ -60,10 +69,11 @@ path_url=$(ynh_normalize_url_path $path_url)
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
-sudo cp -a "$tmpdir/.htconfig.php" "${final_path}"
-if [ -f $final_path/.htaccess ]; then
- cp -af "$tmpdir/.htaccess" "${final_path}"
-fi
+sudo cp -af "$tmpdir/.htaccess" "${final_path}"
+sudo cp -af "$tmpdir/view/smarty3" "${final_path}/view/smarty3"
+sudo cp -af "$tmpdir/config/local.ini.php" "${final_path}/config/local.ini.php"
+
+
sudo rm -Rf "$tmpdir"
#Copy Addons