13 lines
215 B
Bash
13 lines
215 B
Bash
#!/bin/bash
|
|
log_file="$1"
|
|
if [ -f "$log_file" ]; then
|
|
head -n -1 "$log_file"
|
|
exit_code=$(tail -n 1 "$log_file")
|
|
if [[ "$exit_code" == "Exit Code: 0" ]]; then
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|
|
else
|
|
exit 1
|
|
fi |