From f9e6f9f7b7287811bb9d9209678731c8f96be7ce Mon Sep 17 00:00:00 2001 From: Attila Kovacs Date: Fri, 20 Dec 2024 16:51:31 +0100 Subject: [PATCH] Error return in smax-init.sh --- smax-init.sh | 6 ++++++ smax-load-functions.sh | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/smax-init.sh b/smax-init.sh index 0375ad9..09b2c58 100755 --- a/smax-init.sh +++ b/smax-init.sh @@ -39,8 +39,14 @@ load_script() { SCRIPT=`cat $LUA/$NAME.lua` SHA1=`redis-cli script load "$SCRIPT"` redis-cli hset scripts $NAME $SHA1 + + if [ $? -ne 0 ] ; then + echo "ERROR! loading $NAME. Goodbye!" + exit 1 + fi } + load_script HGetWithMeta load_script HSetWithMeta load_script HMGetWithMeta diff --git a/smax-load-functions.sh b/smax-load-functions.sh index 89dcef4..063235d 100755 --- a/smax-load-functions.sh +++ b/smax-load-functions.sh @@ -30,6 +30,11 @@ load_function() { NAME=$1 echo -n "> Loading $NAME. New? " `cat $LUA/$NAME | redis-cli function load replace` + + if [ $? -ne 0 ] ; then + echo "ERROR! loading $NAME. Goodbye!" + exit 1 + fi } load_function smax.lib