Skip to content

Commit 3c5fd88

Browse files
check arguments
check if arguments are practically feasible
1 parent 3013e66 commit 3c5fd88

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

power-notify.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ check_args() {
2020
lower_limit="$2"
2121
upper_limit="$1"
2222
fi
23+
24+
if [[ "$lower_limit" -le 0 || "$upper_limit" -gt 100 ]]; then
25+
echo "lower limit cannot be less than or equal to zero"
26+
echo "upper limit cannot be greater than 100"
27+
exit 1
28+
fi
2329
}
2430

2531
start_listener() {

0 commit comments

Comments
 (0)