Update main.sh

This commit is contained in:
myvesta 2023-02-23 15:58:00 +01:00 committed by GitHub
parent 8dcbafcc73
commit 0fae1613e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,7 +86,9 @@ log_history() {
# Result checker # Result checker
check_result() { check_result() {
if [ $1 -ne 0 ]; then if [ $1 -ne 0 ]; then
echo "Error: $2" if [ -z "$SILENT_MODE" ]; then
echo "Error: $2"
fi
if [ ! -z "$3" ]; then if [ ! -z "$3" ]; then
log_event "$3" "$ARGUMENTS" log_event "$3" "$ARGUMENTS"
exit $3 exit $3
@ -100,7 +102,9 @@ check_result() {
# Argument list checker # Argument list checker
check_args() { check_args() {
if [ "$1" -gt "$2" ]; then if [ "$1" -gt "$2" ]; then
echo "Usage: $(basename $0) $3" if [ -z "$SILENT_MODE" ]; then
echo "Usage: $(basename $0) $3"
fi
check_result $E_ARGS "not enought arguments" >/dev/null check_result $E_ARGS "not enought arguments" >/dev/null
fi fi
} }