Skip to content

Commit 941eda5

Browse files
committed
disk-usage.sh: use non-zero exit codes as needed
For each filesystem which is not within bounds of the threshold, increment the exit code. That way, Jenkins builds using this script will fail if any of the tested filesystems are not within required bounds.
1 parent 49f1eb4 commit 941eda5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

disk-usage.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ check() {
1515
}
1616

1717
threshold=80
18+
code=0
1819
while test $# -gt 0
1920
do
2021
case "$1" in
@@ -23,8 +24,10 @@ do
2324
threshold="$1"
2425
;;
2526
*)
26-
check "$1"
27+
check "$1" || code=$((code+1))
2728
;;
2829
esac
2930
shift
3031
done
32+
33+
exit $code

0 commit comments

Comments
 (0)