1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/netdata_ynh.git synced 2024-09-03 19:46:33 +02:00
netdata_ynh/hooks/post_domain_add
2022-07-05 08:48:13 +02:00

12 lines
No EOL
316 B
Bash

#!/bin/bash
# Retrieve arguments
domain=$1
domain_label=${domain//\./_} # Replace "." by "_" for the domain label
# Add a web_log entry for this new domain
cat >> /opt/netdata/etc/netdata/go.d/web_log.conf <<EOF
- ${domain_label}_log:
name: '${domain_label}'
path: '/var/log/nginx/$domain-access.log'
EOF