mirror of
https://github.com/YunoHost-Apps/agora_ynh.git
synced 2024-09-03 18:06:21 +02:00
73 lines
2.2 KiB
Bash
73 lines
2.2 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# INITIALIZE AND STORE SETTINGS
|
|
#=================================================
|
|
|
|
admin_lastname=$(ynh_user_get_info "$admin" lastname)
|
|
admin_firstname=$(ynh_user_get_info "$admin" firstname)
|
|
admin_mail=$(ynh_user_get_info "$admin" mail)
|
|
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
ynh_script_progression --message="Setting up source files..."
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
|
ynh_setup_source --dest_dir="$install_dir"
|
|
|
|
chmod 750 "$install_dir"
|
|
chmod -R o-rwx "$install_dir"
|
|
chown -R "$app:www-data" "$install_dir"
|
|
|
|
#=================================================
|
|
# SYSTEM CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
|
|
|
# Create a dedicated PHP-FPM config
|
|
ynh_add_fpm_config
|
|
|
|
# Create a dedicated NGINX config
|
|
ynh_add_nginx_config
|
|
|
|
#=================================================
|
|
# SPECIFIC SETUP
|
|
#=================================================
|
|
# SETUP APPLICATION WITH CURL
|
|
#=================================================
|
|
ynh_script_progression --message="Setting up application with CURL..."
|
|
|
|
ynh_local_curl "/?ctrl=offline&action=install&disconnect=1" \
|
|
"lang=$language" \
|
|
"db_host=localhost" \
|
|
"db_name=$db_name" \
|
|
"db_login=$db_user" \
|
|
"db_password=$db_pwd" \
|
|
"adminName=$admin_lastname" \
|
|
"adminFirstName=$admin_firstname" \
|
|
"adminMailLogin=$admin_mail" \
|
|
"adminPassword=$password" \
|
|
"adminPasswordVerif=$password" \
|
|
"spaceName=YunoHost" \
|
|
"spaceDescription=YunoHost" \
|
|
"spacePublic=0" \
|
|
"ctrl=offline" \
|
|
"action=install" \
|
|
"formValidate=1" \
|
|
"submit=submit"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Installation of $app completed"
|