Feat: Erstellt die Logdatei, wenn sie nicht vorhanden ist.

This commit is contained in:
DragonSlayer_14 2025-03-03 22:36:00 +01:00
parent 50fccc03ab
commit 12e6cc7e32

View File

@ -9,6 +9,9 @@ log() {
if [ ! -d "$LOGDIR" ]; then if [ ! -d "$LOGDIR" ]; then
mkdir -p "$LOGDIR" mkdir -p "$LOGDIR"
fi fi
if [ ! -f "$LOGFILE" ]; then
touch "$LOGFILE"
fi
echo "$(date +'%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOGFILE" echo "$(date +'%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOGFILE"
} }