1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/flarum_ynh.git synced 2024-09-03 18:36:24 +02:00

Merge pull request #92 from YunoHost-Apps/patch-21

[fix] Remove useless Condition
This commit is contained in:
Titus PiJean 2018-08-31 16:39:58 +02:00 committed by GitHub
commit ab683da2d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,11 +125,11 @@ ynh_app_setting_set "$app" db_pwd "$db_pwd"
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
if [ $path_url = "/" ]; then if [ $path_url = "/" ]; then
sed -i "s@__LOCATION_HACK__@@g" ../conf/nginx.conf ynh_replace_string "__LOCATION_HACK__" "" "../conf/nginx.conf"
sed -i "s@__PATH_HACK__@/@g" ../conf/nginx.conf ynh_replace_string "__PATH_HACK__" "/" "../conf/nginx.conf"
else else
sed -i "s@__LOCATION_HACK__@$path_url@g" ../conf/nginx.conf ynh_replace_string "__LOCATION_HACK__" "$path_url" "../conf/nginx.conf"
sed -i "s@__PATH_HACK__@$path_url$path_url@g" ../conf/nginx.conf ynh_replace_string "__PATH_HACK__" "$path_url$path_url" "../conf/nginx.conf"
fi fi
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -173,8 +173,6 @@ systemctl reload nginx
# FLARUM POST-INSTALL # FLARUM POST-INSTALL
#================================================= #=================================================
if [[ -n $admin && -n $title ]]; then
# If admin user and title were specified, start post-installation
# Copy the configuration.yml to working directory # Copy the configuration.yml to working directory
finalflarumconf="$final_path/configuration.yml" finalflarumconf="$final_path/configuration.yml"
cp ../conf/configuration.yml $finalflarumconf cp ../conf/configuration.yml $finalflarumconf
@ -183,14 +181,14 @@ if [[ -n $admin && -n $title ]]; then
admin_pwd=$(ynh_string_random 8) admin_pwd=$(ynh_string_random 8)
admin_mail=$(ynh_user_get_info $admin mail) admin_mail=$(ynh_user_get_info $admin mail)
# Populate configuration.yml # Populate configuration.yml
sed -i "s@__DOMAIN__@$domain@g" $finalflarumconf ynh_replace_string "__DOMAIN__" "$domain" "$finalflarumconf"
sed -i "s@/__PATH__@$path_url@g" $finalflarumconf ynh_replace_string "/__PATH__" "$path_url" "$finalflarumconf"
sed -i "s@__USER__@$app@g" $finalflarumconf ynh_replace_string "__USER__" "$app" "$finalflarumconf"
sed -i "s@__DB_PWD__@$db_pwd@g" $finalflarumconf ynh_replace_string "__DB_PWD__" "$db_pwd" "$finalflarumconf"
sed -i "s@__ADMIN__@$admin@g" $finalflarumconf ynh_replace_string "__ADMIN__" "$admin" "$finalflarumconf"
sed -i "s@__ADMIN_PWD__@$admin_pwd@g" $finalflarumconf ynh_replace_string "__ADMIN_PWD__" "$admin_pwd" "$finalflarumconf"
sed -i "s%__ADMIN_EML__%$admin_mail%g" $finalflarumconf ynh_replace_string "__ADMIN_EML__" "$admin_mail" "$finalflarumconf"
sed -i "s@__FORUM_TITLE__@$title@g" $finalflarumconf ynh_replace_string "__FORUM_TITLE__" "$title" "$finalflarumconf"
# Execute post-installation # Execute post-installation
pushd $final_path pushd $final_path
exec_as $app "php -d $final_path -d memory_limit=-1 flarum install -f configuration.yml" exec_as $app "php -d $final_path -d memory_limit=-1 flarum install -f configuration.yml"
@ -238,9 +236,3 @@ if [[ -n $admin && -n $title ]]; then
Your forum is accessible at https://$domain$path_url" Your forum is accessible at https://$domain$path_url"
>&2 echo $app_message >&2 echo $app_message
ynh_send_readme_to_admin "$app_message" "$admin" ynh_send_readme_to_admin "$app_message" "$admin"
else
# If admin user and title were not specified, ask admin to perform manual post-installation
app_message="Post-installation required, visit your Flarum instance."
>&2 echo $app_message
ynh_send_readme_to_admin "$app_message" "$admin"
fi