]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Fix: xalarm: simple argument checking
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 5 Jun 2022 13:10:29 +0000 (10:10 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 5 Jun 2022 13:10:29 +0000 (10:10 -0300)
xalarm

diff --git a/xalarm b/xalarm
index 399e4e6c93281ec1df5dc7a6799ba39baf6a69d2..63baf434530bfb1e926d7a8c5a6e70efa86e0193 100755 (executable)
--- 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`"