From ff156897048aac45cc983baefcd374aa5e05d183 Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:29:18 +0000 Subject: [PATCH] Netdata fixes --- .../universal/run_onchange_after_57-netdata.sh.tmpl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.sh.tmpl index b6179959..58daaad6 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.sh.tmpl @@ -21,6 +21,11 @@ ensureNetdataOwnership() { elif [ -d /var/lib/netdata ]; then logg info 'Ensuring permissions are correct on /var/lib/netdata' sudo chown -Rf netdata:netdata /var/lib/netdata || sudo chown -Rf netdata:$(id -g -n) /var/lib/netdata + elif [ -d "$HOMEBREW_PREFIX/var/lib/netdata" ]; then + logg info "Ensuring permissions are correct on $HOMEBREW_PREFIX/var/lib/netdata" + sudo chown -Rf netdata:netdata "$HOMEBREW_PREFIX/var/lib/netdata" || sudo chown -Rf netdata:$(id -g -n) "$HOMEBREW_PREFIX/var/lib/netdata" + else + logg warn 'No /var/lib/netdata folder found' fi } @@ -61,6 +66,8 @@ if command -v netdata-claim.sh > /dev/null; then NETDATA_ETC='/usr/local/etc/netdata/' elif [ -d /etc/netdata ]; then NETDATA_ETC='/etc/netdata' + elif [ -d "$HOMEBREW_PREFIX/etc/netdata" ]; then + NETDATA_ETC="$HOMEBREW_PREFIX/etc/netdata" else logg error 'No etc location found for netdata' && exit 1 fi