initial commit

This commit is contained in:
2024-03-22 07:02:10 +01:00
commit 8baec552ac
13 changed files with 623 additions and 0 deletions

32
logger.sh Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
. /home/spezi/Scripts/utils/colors.sh
logger () {
echo -e "${NC}$(date) - [$BASHPID] - [${0##*/}] - $@${NC}"
}
loggerseparator () {
echo -e "${NC}$(date) - [$BASHPID] - ====================================="
}
saferun () {
allcommands=""
for var in "$@"; do
allcommands="$allcommands$var /// "
done
logger "Enter to run the following command(s): $allcommands"
read ok
ret=0
for var in "$@"; do
if [[ $ret -eq 0 ]]; then
$var
ret=$?
else
logger "command $var aborted because previous command exited non-zero!"
fi
done
loggerseparator
logger "Command(s) done!"
loggerseparator
}