dotfiles/scripts/dummy_error_script.sh
2025-04-06 15:37:42 +01:00

12 lines
328 B
Bash
Executable file

#!/bin/bash
THIS_FILE=${0}
SLACK_NOTIFIER="/home/thomas/repos/utilities/slack_notifier.sh"
COMMAND=$(ls /nonexisting_dir 2>&1 1>/dev/null)
#COMMAND=$(ls . 2>&1 1>/dev/null)
if ! $COMMAND; then
$SLACK_NOTIFIER "test" "error" "Something went wrong" "$COMMAND" "$THIS_FILE"
else
$SLACK_NOTIFIER "test" "success" "All good!"
fi