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

57 lines
1.8 KiB
Text
Raw Normal View History

2021-01-12 18:39:03 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2021-07-17 12:32:05 +02:00
ynh_script_progression --message="Setting up source files..." --weight=3
2021-01-12 18:39:03 +01:00
# Download, check integrity, uncompress and patch the source from app.src
2024-01-16 21:51:49 +01:00
ynh_setup_source --dest_dir="$install_dir"
2021-01-12 18:39:03 +01:00
2024-01-16 21:51:49 +01:00
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
2021-07-17 12:00:15 +02:00
2021-01-12 18:39:03 +01:00
#=================================================
2024-01-16 21:51:49 +01:00
# MODIFY A CONFIG FILE
2021-01-12 18:39:03 +01:00
#=================================================
2024-01-16 21:51:49 +01:00
ynh_script_progression --message="Setting up a configuration file..." --weight=1
2021-01-12 18:39:03 +01:00
2024-01-16 21:51:49 +01:00
ynh_add_config --template="config.php.sample" --destination="$install_dir/config.php"
chmod 400 "$install_dir/config.php"
chown "$app" "$install_dir/config.php"
2021-01-12 18:39:03 +01:00
#=================================================
2024-01-16 21:51:49 +01:00
# SYSTEM CONFIGURATION
2021-01-12 18:39:03 +01:00
#=================================================
2024-01-16 21:51:49 +01:00
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
2021-01-12 18:39:03 +01:00
# Create a dedicated PHP-FPM config
2021-11-14 15:42:49 +01:00
ynh_add_fpm_config
2021-02-10 18:00:18 +01:00
2024-01-16 21:51:49 +01:00
# Create a dedicated NGINX config
ynh_add_nginx_config
2021-02-10 18:00:18 +01:00
2021-01-12 18:39:03 +01:00
#=================================================
2021-07-17 12:00:15 +02:00
# SETUP A CRON
2021-01-12 18:39:03 +01:00
#=================================================
2024-01-16 21:51:49 +01:00
ynh_script_progression --message="Setting up a cron..." --weight=1
2021-01-12 18:39:03 +01:00
2021-07-17 12:00:15 +02:00
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
2021-01-12 18:39:03 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2021-07-17 12:00:15 +02:00
ynh_script_progression --message="Installation of $app completed" --last