1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yunomonitor_ynh.git synced 2024-09-03 17:46:11 +02:00
yunomonitor_ynh/scripts/_common.sh
2024-01-19 17:04:34 +01:00

35 lines
1.3 KiB
Bash

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
#=================================================
# PERSONAL HELPERS
#=================================================
_yunomonitor_add_nginx_config() {
# Create a dedicated nginx config
# Note: i don't use the helper because i need this file to be named "000-"
finalnginxconf="/etc/nginx/conf.d/$domain.d/000-$app.conf"
ynh_backup_if_checksum_is_different --file="$finalnginxconf"
cp ../conf/nginx.conf "$finalnginxconf"
ynh_replace_string --match_string="__INSTALL_DIR__" --replace_string="$install_dir" --target_file="$finalnginxconf"
ynh_store_file_checksum --file="$finalnginxconf"
}
_yunomonitor_remove_nginx_config() {
finalnginxconf="/etc/nginx/conf.d/$domain.d/000-$app.conf"
ynh_secure_remove --file="$finalnginxconf"
# Workaround for app linter that does not want you to reload nginx
service=nginx
ynh_systemd_action --service_name="$service" --action=reload
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================