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

60 lines
1.9 KiB
Text
Raw Normal View History

2019-12-30 10:19:54 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2021-11-19 22:13:26 +01:00
ynh_script_progression --message="Setting up source files..." --weight=4
2019-12-30 10:19:54 +01:00
# Download, check integrity, uncompress and patch the source from app.src
2024-01-13 12:13:28 +01:00
ynh_setup_source --dest_dir="$install_dir"
2021-11-19 21:46:31 +01:00
2024-01-13 12:13:28 +01:00
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
2019-12-30 10:19:54 +01:00
#=================================================
2024-01-13 12:13:28 +01:00
# ADD A CONFIGURATION
2019-12-30 10:19:54 +01:00
#=================================================
2024-01-13 12:13:28 +01:00
ynh_script_progression --message="Adding a configuration file..." --weight=1
2019-12-30 10:19:54 +01:00
2024-01-13 12:13:28 +01:00
# Import DB
ynh_mysql_execute_file_as_root --file="$install_dir/database/phplicensewatcher.sql" --database="$db_name"
ynh_add_config --template="config.php" --destination="$install_dir/config.php"
chmod 400 "$install_dir/config.php"
chown "$app:$app" "$install_dir/config.php"
2019-12-30 10:19:54 +01:00
#=================================================
2024-01-13 12:13:28 +01:00
# SYSTEM CONFIGURATION
2019-12-30 10:19:54 +01:00
#=================================================
2024-01-13 12:13:28 +01:00
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
2019-12-30 10:19:54 +01:00
2021-11-19 21:46:31 +01:00
# Create a dedicated PHP-FPM config
ynh_add_fpm_config
2019-12-30 10:19:54 +01:00
2024-01-13 12:13:28 +01:00
# Create a dedicated NGINX config
ynh_add_nginx_config
2021-11-19 21:55:25 +01:00
#=================================================
# SETUP A CRON
#=================================================
2024-01-13 12:13:28 +01:00
ynh_script_progression --message="Setting up a cron job..." --weight=1
2021-11-19 21:55:25 +01:00
2024-01-13 12:13:28 +01:00
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
2021-11-19 21:55:25 +01:00
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
2019-12-30 10:19:54 +01:00
#=================================================
2021-11-19 21:46:31 +01:00
# END OF SCRIPT
2019-12-30 10:19:54 +01:00
#=================================================
2021-11-19 22:13:26 +01:00
ynh_script_progression --message="Installation of $app completed" --last