Skip to content

Commit

Permalink
fix: add crowsnest log path to postrename script
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
meteyou committed Aug 7, 2023
1 parent ba3d582 commit 46e60b1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/modules/postrename/filesystem/root/postrename
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ change_www_root() {
"
}


### change username in service files
change_service_user() {
### Filter nginx service first!
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 46e60b1

Please sign in to comment.