feat: auto mainsailOS / fluiddPi migration

script: make use of moonrakers new log_path configuration option

script: create webui nginx log symlinks upon installation/update
This commit is contained in:
th33xitus
2021-06-11 12:09:10 +02:00
parent f804fcb65d
commit d344b1c5f6
7 changed files with 140 additions and 11 deletions

View File

@@ -100,6 +100,9 @@ install_webui(){
### creating the mainsail/fluidd nginx cfg
set_nginx_cfg "$1"
### symlink nginx log
symlink_webui_nginx_log "$1"
### copy the kiauh_macros.cfg to the config location
install_kiauh_macros
@@ -114,6 +117,23 @@ install_webui(){
print_msg && clear_msg
}
symlink_webui_nginx_log(){
LPATH="${HOME}/klipper_logs"
UI_ACCESS_LOG="/var/log/nginx/$1-access.log"
UI_ERROR_LOG="/var/log/nginx/$1-error.log"
[ ! -d "$LPATH" ] && mkdir -p "$LPATH"
if [ -f "$UI_ACCESS_LOG" ] && [ ! -L "$LPATH/$1-access.log" ]; then
status_msg "Creating symlink for $UI_ACCESS_LOG ..."
ln -s $UI_ACCESS_LOG "$LPATH"
ok_msg "OK!"
fi
if [ -f "$UI_ERROR_LOG" ] && [ ! -L "$LPATH/$1-error.log" ]; then
status_msg "Creating symlink for $UI_ERROR_LOG ..."
ln -s $UI_ERROR_LOG "$LPATH"
ok_msg "OK!"
fi
}
install_kiauh_macros(){
source_kiauh_ini
### copy kiauh_macros.cfg