refactor(log-upload): update log upload functions and re-enable access

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus
2023-08-26 18:06:14 +02:00
parent 9f410450d7
commit c777ba3e6b
3 changed files with 9 additions and 10 deletions

View File

@@ -9,9 +9,6 @@
# This file may be distributed under the terms of the GNU GPLv3 license #
#=======================================================================#
# TODO: upload_log
# TODO: doublecheck that nothing got missed!
set -e
clear

View File

@@ -112,8 +112,7 @@ function main_menu() {
"restart crowsnest") do_action_service "restart" "crowsnest"; main_ui;;
update) do_action "update_kiauh" "main_ui";;
0)clear && print_header
#upload_selection
print_error "Function currently disabled! Sorry!"
upload_selection
main_ui;;
1)clear && print_header
install_menu

View File

@@ -54,7 +54,6 @@ function upload_selection() {
[[ ${upload_agreed} == "false" ]] && accept_upload_conditions
local logfiles
local logs_dir="${KLIPPER_LOGS}"
local webif_logs="/var/log/nginx"
function find_logfile() {
@@ -64,14 +63,18 @@ function upload_selection() {
done
}
find_logfile "kiauh\.log" "/tmp"
find_logfile "klippy(-[0-9a-zA-Z]+)?\.log" "${logs_dir}"
find_logfile "moonraker(-[0-9a-zA-Z]+)?\.log" "${logs_dir}"
find_logfile "telegram(-[0-9a-zA-Z]+)?\.log" "${logs_dir}"
local logdir log_dirs
log_dirs=$(get_instance_folder_path "logs")
for logdir in ${log_dirs}; do
find_logfile "klippy(-[0-9a-zA-Z]+)?\.log" "${logdir}"
find_logfile "moonraker(-[0-9a-zA-Z]+)?\.log" "${logdir}"
find_logfile "telegram(-[0-9a-zA-Z]+)?\.log" "${logdir}"
done
find_logfile "mainsail.*" "${webif_logs}"
find_logfile "fluidd.*" "${webif_logs}"
find_logfile "KlipperScreen.log" "/tmp"
find_logfile "webcamd\.log(\.[0-9]+)?$" "/var/log"
find_logfile "kiauh\.log" "/tmp"
### draw interface
local i=0