diff --git a/scripts/install b/scripts/install index 92477ea..60d6a73 100755 --- a/scripts/install +++ b/scripts/install @@ -215,6 +215,9 @@ pushd $final_path/$app #Generate key pair sudo -u "$app" MIX_ENV=prod mix web_push.gen.keypair >> "config/prod.secret.exs" ynh_replace_string "administrator@example.com" "$admin_email" "$final_path/$app/config/prod.secret.exs" + + #Create uploads dir + mkdir uploads popd #================================================= diff --git a/scripts/remove b/scripts/remove index 4089ddd..cf83f1d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -74,7 +74,7 @@ ynh_remove_app_dependencies #================================================= ynh_print_info "Removing erlang repository..." -ynh_secure_remove "/etc/apt/sources.list.d/${app}.list" +ynh_secure_remove "/etc/apt/sources.list.d/$app.list" apt-key del A14F4FCA #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4749444..e85410b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -80,6 +80,9 @@ then yunohost firewall disallow TCP $port 2>&1 fi +# Remove old repository +ynh_secure_remove "/etc/apt/sources.list.d/erlang-solutions.list" + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -139,6 +142,20 @@ then ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf" fi +#================================================= +# ADD ERLANG REPOSITORY +#================================================= +ynh_print_info "Adding Erlang repository..." + +wget https://packages.erlang-solutions.com/debian/erlang_solutions.asc +apt-key add erlang_solutions.asc +rm erlang_solutions.asc +if [ "$(lsb_release --codename --short)" == "jessie" ]; then + echo "deb http://packages.erlang-solutions.com/debian jessie contrib" | tee /etc/apt/sources.list.d/$app.list +elif [ "$(lsb_release --codename --short)" == "stretch" ]; then + echo "deb http://packages.erlang-solutions.com/debian stretch contrib" | tee /etc/apt/sources.list.d/$app.list +fi +ynh_package_update #================================================= # UPGRADE DEPENDENCIES #=================================================