1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/collabora_ynh.git synced 2024-09-03 18:16:25 +02:00

[Fix] Helper

This commit is contained in:
frju365 2017-08-24 11:21:17 +02:00 committed by GitHub
parent c59dec36b5
commit 9d781082e8

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# ============================================================================= # =============================================================================
# YUNOHOST 2.6 FORTHCOMING HELPERS # YUNOHOST 2.7 FORTHCOMING HELPERS
# ============================================================================= # =============================================================================
# Create a dedicated nginx config # Create a dedicated nginx config
@ -9,7 +9,7 @@
# usage: ynh_add_nginx_config # usage: ynh_add_nginx_config
ynh_add_nginx_config () { ynh_add_nginx_config () {
finalnginxconf="/etc/nginx/conf.d/$domain.d/$app.conf" finalnginxconf="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup_if_checksum_is_different "$finalnginxconf" 1 ynh_backup_if_checksum_is_different "$finalnginxconf"
sudo cp ../conf/nginx.conf "$finalnginxconf" sudo cp ../conf/nginx.conf "$finalnginxconf"
# To avoid a break by set -u, use a void substitution ${var:-}. If the variable is not set, it's simply set with an empty variable. # To avoid a break by set -u, use a void substitution ${var:-}. If the variable is not set, it's simply set with an empty variable.
@ -29,7 +29,7 @@ ynh_add_nginx_config () {
if test -n "${final_path:-}"; then if test -n "${final_path:-}"; then
ynh_replace_string "__FINALPATH__" "$final_path" "$finalnginxconf" ynh_replace_string "__FINALPATH__" "$final_path" "$finalnginxconf"
fi fi
ynh_store_checksum_config "$finalnginxconf" ynh_store_file_checksum "$finalnginxconf"
sudo systemctl reload nginx sudo systemctl reload nginx
} }
@ -47,7 +47,7 @@ ynh_remove_nginx_config () {
# usage: ynh_add_fpm_config # usage: ynh_add_fpm_config
ynh_add_fpm_config () { ynh_add_fpm_config () {
finalphpconf="/etc/php5/fpm/pool.d/$app.conf" finalphpconf="/etc/php5/fpm/pool.d/$app.conf"
ynh_backup_if_checksum_is_different "$finalphpconf" 1 ynh_backup_if_checksum_is_different "$finalphpconf"
sudo cp ../conf/php-fpm.conf "$finalphpconf" sudo cp ../conf/php-fpm.conf "$finalphpconf"
ynh_replace_string "__NAMETOCHANGE__" "$app" "$finalphpconf" ynh_replace_string "__NAMETOCHANGE__" "$app" "$finalphpconf"
ynh_replace_string "__FINALPATH__" "$final_path" "$finalphpconf" ynh_replace_string "__FINALPATH__" "$final_path" "$finalphpconf"
@ -58,10 +58,10 @@ ynh_add_fpm_config () {
if [ -e "../conf/php-fpm.ini" ] if [ -e "../conf/php-fpm.ini" ]
then then
finalphpini="/etc/php5/fpm/conf.d/20-$app.ini" finalphpini="/etc/php5/fpm/conf.d/20-$app.ini"
ynh_compare_checksum_config "$finalphpini" 1 ynh_backup_if_checksum_is_different "$finalphpini"
sudo cp ../conf/php-fpm.ini "$finalphpini" sudo cp ../conf/php-fpm.ini "$finalphpini"
sudo chown root: "$finalphpini" sudo chown root: "$finalphpini"
ynh_store_checksum_config "$finalphpini" ynh_store_file_checksum "$finalphpini"
fi fi
sudo systemctl reload php5-fpm sudo systemctl reload php5-fpm
@ -81,7 +81,7 @@ ynh_remove_fpm_config () {
# usage: ynh_add_systemd_config # usage: ynh_add_systemd_config
ynh_add_systemd_config () { ynh_add_systemd_config () {
finalsystemdconf="/etc/systemd/system/$app.service" finalsystemdconf="/etc/systemd/system/$app.service"
ynh_compare_checksum_config "$finalsystemdconf" 1 ynh_backup_if_checksum_is_different "$finalsystemdconf"
sudo cp ../conf/systemd.service "$finalsystemdconf" sudo cp ../conf/systemd.service "$finalsystemdconf"
# To avoid a break by set -u, use a void substitution ${var:-}. If the variable is not set, it's simply set with an empty variable. # To avoid a break by set -u, use a void substitution ${var:-}. If the variable is not set, it's simply set with an empty variable.
@ -92,7 +92,7 @@ ynh_add_systemd_config () {
if test -n "${app:-}"; then if test -n "${app:-}"; then
ynh_replace_string "__APP__" "$app" "$finalsystemdconf" ynh_replace_string "__APP__" "$app" "$finalsystemdconf"
fi fi
ynh_store_checksum_config "$finalsystemdconf" ynh_store_file_checksum "$finalsystemdconf"
sudo chown root: "$finalsystemdconf" sudo chown root: "$finalsystemdconf"
sudo systemctl enable $app sudo systemctl enable $app