1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/phpbb_ynh.git synced 2024-09-03 19:56:36 +02:00
phpbb_ynh/scripts/install

69 lines
2.3 KiB
Text
Raw Permalink Normal View History

2015-03-07 13:58:05 +01:00
#!/bin/bash
2017-10-21 21:35:03 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
2021-06-28 11:19:06 +02:00
email=$(ynh_user_get_info --username=$admin --key=mail)
2017-10-21 21:35:03 +02:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2021-06-28 10:27:01 +02:00
ynh_script_progression --message="Setting up source files..." --weight=5
2017-10-21 21:35:03 +02:00
# Download, check integrity, uncompress and patch the source from app.src
2023-05-23 10:14:37 +02:00
ynh_setup_source --dest_dir="$install_dir"
2021-06-28 10:00:43 +02:00
2021-06-28 14:07:56 +02:00
tmpdir="$(mktemp -d)"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$tmpdir" --source_id=fr
2023-05-23 10:14:37 +02:00
cp -a "$tmpdir/language/fr" "$install_dir/language/fr"
cp -a "$tmpdir/styles/prosilver/theme/fr" "$install_dir/styles/prosilver/theme/fr"
2021-06-28 14:07:56 +02:00
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
2023-05-23 10:14:37 +02:00
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
2022-03-10 01:03:56 +01:00
2017-10-21 21:35:03 +02:00
#=================================================
2024-06-26 08:43:41 +02:00
# APP INITIAL CONFIGURATION
2017-10-21 21:35:03 +02:00
#=================================================
2024-06-26 08:43:41 +02:00
ynh_script_progression --message="Adding $app's configuration files..." --weight=1
2021-06-28 17:25:52 +02:00
2024-06-26 08:42:17 +02:00
ynh_add_config --template="install-config.yml.default" --destination="$install_dir/install/install-config.yml"
2021-06-28 10:00:43 +02:00
2023-05-23 10:14:37 +02:00
ynh_exec_as "$app" php${phpversion} "$install_dir/install/phpbbcli.php" -q --no-interaction install "$install_dir/install/install-config.yml"
2021-06-28 10:00:43 +02:00
2023-05-23 10:14:37 +02:00
mv "$install_dir/install" "$install_dir/install_old"
2021-06-28 10:00:43 +02:00
2021-06-28 17:26:43 +02:00
#=================================================
2024-06-26 08:43:41 +02:00
# SYSTEM CONFIGURATION
2021-06-28 17:26:43 +02:00
#=================================================
2024-06-26 08:43:41 +02:00
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
2023-05-23 10:24:50 +02:00
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated PHP-FPM config
2024-06-26 08:42:17 +02:00
ynh_add_fpm_config
2021-06-28 17:26:43 +02:00
2024-06-26 08:42:17 +02:00
ynh_add_config --template="phpbb.cron" --destination="/etc/cron.d/$app"
2021-11-08 23:17:33 +01:00
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
2017-10-21 21:35:03 +02:00
2021-06-28 10:00:43 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2021-06-28 10:27:01 +02:00
ynh_script_progression --message="Installation of $app completed" --last