mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
New helpers ynh_add_fpm_config and ynh_remove_fpm_config (#284)
* New helpers ynh_add_fpm_config and ynh_remove_fpm_config Standard configuration of php-fpm. Use local files stored in conf/, so it's still possible to use a specific config * ynh_substitute_char was renamed to ynh_replace_string * Update checksum command and quiet the second secure_remove * Fix helpers name
This commit is contained in:
parent
f0c9e697fe
commit
9782f05887
1 changed files with 34 additions and 0 deletions
|
@ -51,3 +51,37 @@ ynh_remove_logrotate () {
|
|||
sudo rm "/etc/logrotate.d/$app"
|
||||
fi
|
||||
}
|
||||
|
||||
# Create a dedicated php-fpm config
|
||||
#
|
||||
# usage: ynh_add_fpm_config
|
||||
ynh_add_fpm_config () {
|
||||
finalphpconf="/etc/php5/fpm/pool.d/$app.conf"
|
||||
ynh_backup_if_checksum_is_different "$finalphpconf"
|
||||
sudo cp ../conf/php-fpm.conf "$finalphpconf"
|
||||
ynh_replace_string "__NAMETOCHANGE__" "$app" "$finalphpconf"
|
||||
ynh_replace_string "__FINALPATH__" "$final_path" "$finalphpconf"
|
||||
ynh_replace_string "__USER__" "$app" "$finalphpconf"
|
||||
sudo chown root: "$finalphpconf"
|
||||
ynh_store_file_checksum "$finalphpconf"
|
||||
|
||||
if [ -e "../conf/php-fpm.ini" ]
|
||||
then
|
||||
finalphpini="/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
ynh_backup_if_checksum_is_different "$finalphpini"
|
||||
sudo cp ../conf/php-fpm.ini "$finalphpini"
|
||||
sudo chown root: "$finalphpini"
|
||||
ynh_store_file_checksum "$finalphpini"
|
||||
fi
|
||||
|
||||
sudo systemctl reload php5-fpm
|
||||
}
|
||||
|
||||
# Remove the dedicated php-fpm config
|
||||
#
|
||||
# usage: ynh_remove_fpm_config
|
||||
ynh_remove_fpm_config () {
|
||||
ynh_secure_remove "/etc/php5/fpm/pool.d/$app.conf"
|
||||
ynh_secure_remove "/etc/php5/fpm/conf.d/20-$app.ini" 2>&1
|
||||
sudo systemctl reload php5-fpm
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue