Checkings and warning (SEQ8 overflow)
authorEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Fri, 29 Jan 2016 16:11:30 +0000 (17:11 +0100)
committerEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Fri, 29 Jan 2016 16:11:30 +0000 (17:11 +0100)
example/diameter/launcher/resources/scripts/clone.sh

index 747e8b0..84a9479 100755 (executable)
@@ -181,6 +181,9 @@ then
 fi
 
 N_ITEMS=$((CLONE_SEQ_END - CLONE_SEQ_BEGIN + 1))
+[ "$N_ITEMS" -lt 1 ] && _exit "Initial sequence ($CLONE_SEQ_BEGIN) provided must be under final sequence value ($CLONE_SEQ_END) !!"
+[ "$CLONE_SEQ_END" -gt "99999999" ] && echo "Warning: some sequence value in range provided overflows __SEQ8__ and derived variables (__IPV4__ and __IPV4HEX__). Be care about using them ..."
+
 if [ -z "$N_GROUPS" ]
 then
   N_GROUPS=$((N_ITEMS/25))