From 1695a4ee02fbab84fa6e1b552c1200142b1ef8c9 Mon Sep 17 00:00:00 2001 From: Tom E Date: Wed, 14 Dec 2022 14:54:34 -0500 Subject: [PATCH] better log thing --- palera1n.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/palera1n.sh b/palera1n.sh index be1a3e4..09eaf8f 100755 --- a/palera1n.sh +++ b/palera1n.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash mkdir -p logs -set -e +set -e + +log="$(date +%T)"-"$(date +%F)"-"$(uname)"-"$(uname -r)".log +cd logs +touch "$log" +cd .. { @@ -292,11 +297,7 @@ _exit_handler() { if [ -d "logs" ]; then cd logs - for file in *.log; do - if [[ "$file" != "SUCCESS_"* ]] && [[ "$file" != "FAIL_"* ]]; then - mv "$file" FAIL_${file} - fi - done + mv "$log" FAIL_${log} cd .. fi @@ -991,11 +992,7 @@ fi if [ -d "logs" ]; then cd logs - for file in *.log; do - if [[ "$file" != "SUCCESS_"* ]] && [[ "$file" != "FAIL_"* ]]; then - mv "$file" SUCCESS_${file} - fi - done + mv "$log" SUCCESS_${log} cd .. fi @@ -1009,4 +1006,4 @@ echo "Otherwise, press Do All in the settings section of the app" echo "If you have any issues, please join the Discord server and ask for help: https://dsc.gg/palera1n" echo "Enjoy!" -} | tee logs/"$(date +%T)"-"$(date +%F)"-"$(uname)"-"$(uname -r)".log +} | tee logs/${log}