summaryrefslogtreecommitdiff
path: root/sts
diff options
context:
space:
mode:
Diffstat (limited to 'sts')
-rwxr-xr-xsts9
1 files changed, 7 insertions, 2 deletions
diff --git a/sts b/sts
index 72771bd..5d0fd49 100755
--- a/sts
+++ b/sts
@@ -1,10 +1,15 @@
#!/bin/sh
# scale triggered store
+WEIGHT="$1"
+
+[ "${WEIGHT}" ] || { echo "First argument must be an amount." >&2; exit 1; }
+[ "${WEIGHT}" -gt 0 ] || { echo "Amount must be larger than zero." >&2; exit 1; }
+
cd $HOME/mat/matplan/
if (grep -q v currently_cooking); then
- PRINT_WITH_LOGO=y ./mat storeportion `cat currently_cooking|sed 's/v//'` "$1" hemfrys
+ PRINT_WITH_LOGO=y ./mat storeportion `cat currently_cooking|sed 's/v//'` "${WEIGHT}" hemfrys
else
- ./mat storeportion `cat currently_cooking|sed 's/v//'` "$1" hemfrys
+ ./mat storeportion `cat currently_cooking|sed 's/v//'` "${WEIGHT}" hemfrys
fi