aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2022-06-05 10:10:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2022-06-05 10:10:29 -0300
commit5a246b2527ae1ed82e8731b9c2752df6b67b7ddd (patch)
treec610d8d31588c33ef5c8a522a9dbbfa2bd3c6745
parent10bd517b3889405a1ec836d5416f421b285ebbed (diff)
downloadutils-x11-5a246b2527ae1ed82e8731b9c2752df6b67b7ddd.tar.gz
utils-x11-5a246b2527ae1ed82e8731b9c2752df6b67b7ddd.tar.bz2
Fix: xalarm: simple argument checking
-rwxr-xr-xxalarm5
1 files changed, 5 insertions, 0 deletions
diff --git a/xalarm b/xalarm
index 399e4e6..63baf43 100755
--- a/xalarm
+++ b/xalarm
@@ -20,6 +20,11 @@ function xalarm_set {
shift
MESSAGE="${*:-Alarm!}"
+ # Simple argument checking
+ if ! echo $DELAY | grep -q '^[0-9]'; then
+ xalarm_usage
+ fi
+
# Suppor for HH:MM format
if echo $DELAY | grep -q '[0-9]:[0-9][0-9]'; then
NOW="`date +%s`"