From 46e60b12980ee73b42edda215b53bb66163271d7 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 6 Aug 2023 18:41:10 +0200 Subject: [PATCH] fix: add crowsnest log path to postrename script Signed-off-by: Stefan Dej --- src/modules/postrename/filesystem/root/postrename | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modules/postrename/filesystem/root/postrename b/src/modules/postrename/filesystem/root/postrename index ea43dc156..98a6357f1 100644 --- a/src/modules/postrename/filesystem/root/postrename +++ b/src/modules/postrename/filesystem/root/postrename @@ -64,7 +64,6 @@ change_www_root() { " } - ### change username in service files change_service_user() { ### Filter nginx service first! @@ -119,6 +118,13 @@ patch_polkit_rules() { fi } +patch_cn_logpath() { + bash -c " + sed -i 's|/home/pi/printer_data/logs/crowsnest.log|/home/${DEFAULT_USER}/printer_data/logs/crowsnest.log|g' \ + /home/${DEFAULT_USER}/printer_data/config/crowsnest.conf + " +} + patch_cn_logrotate() { if [[ -f "/etc/logrotate.d/crowsnest" ]]; then sed -i 's/pi/'"${DEFAULT_USER}"'/g' "/etc/logrotate.d/crowsnest" @@ -205,6 +211,10 @@ echo -e "${WHITE}Trying to relocate venv's ...${NOC}[${GRE}OK${NOC}]" echo -e "${WHITE}Patching moonraker's polkit rules ...${NOC}" patch_polkit_rules echo -e "${WHITE}Patching moonraker's polkit rules ...${NOC}[${GRE}OK${NOC}]" +## patch crownsnest log path +echo -en "${WHITE}Patching crowsnest logpath ...${NOC}\r" +patch_cn_logpath +echo -e "${WHITE}Patching crowsnest logpath ...${NOC}[${GRE}OK${NOC}]" ## patch crowsnest logrotate echo -e "${WHITE}Patching crowsnest logrotate ...${NOC}" patch_cn_logrotate