|
@@ -62,14 +62,19 @@ if [ -z "$GDB" ] ; then
|
|
GDB="$TOOLPATH"
|
|
GDB="$TOOLPATH"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
-if [ -z "$MD5" ]; then
|
|
|
|
- locate_tool md5sum md5
|
|
|
|
- if [ -z "$TOOLPATH" ] ; then
|
|
|
|
- # now error, but we can look for alternative names if it is the case
|
|
|
|
- echo "error: 'md5sum' or 'md5' tool not found: set MD5 variable to correct tool path"
|
|
|
|
- exit
|
|
|
|
|
|
+if [ -z "$CMDHASH" ]; then
|
|
|
|
+ if [ -z "$MD5" ]; then
|
|
|
|
+ locate_tool md5sum md5
|
|
|
|
+ if [ -z "$TOOLPATH" ] ; then
|
|
|
|
+ # now error, but we can look for alternative names if it is the case
|
|
|
|
+ echo "error: 'md5sum' or 'md5' tool not found: set CMDHASH variable to correct tool path"
|
|
|
|
+ exit
|
|
|
|
+ fi
|
|
|
|
+ CMDHASH="$TOOLPATH"
|
|
|
|
+ else
|
|
|
|
+ # handle old variable setting md5 tool
|
|
|
|
+ CMDHASH="$MD5"
|
|
fi
|
|
fi
|
|
- MD5="$TOOLPATH"
|
|
|
|
fi
|
|
fi
|
|
if [ -z "$LAST_LINE" ] ; then
|
|
if [ -z "$LAST_LINE" ] ; then
|
|
locate_tool tail
|
|
locate_tool tail
|
|
@@ -777,7 +782,7 @@ filter_json()
|
|
# output: HA1
|
|
# output: HA1
|
|
_gen_ha1()
|
|
_gen_ha1()
|
|
{
|
|
{
|
|
- HA1=`echo -n "$1:$2:$3" | $MD5 | $AWK '{ print $1 }'`
|
|
|
|
|
|
+ HA1=`echo -n "$1:$2:$3" | $CMDHASH | $AWK '{ print $1 }'`
|
|
if [ $? -ne 0 ] ; then
|
|
if [ $? -ne 0 ] ; then
|
|
echo "HA1 calculation failed"
|
|
echo "HA1 calculation failed"
|
|
exit 1
|
|
exit 1
|
|
@@ -788,7 +793,7 @@ _gen_ha1()
|
|
# output: HA1B
|
|
# output: HA1B
|
|
_gen_ha1b()
|
|
_gen_ha1b()
|
|
{
|
|
{
|
|
- HA1B=`echo -n "$1@$2:$2:$3" | $MD5 | $AWK '{ print $1 }'`
|
|
|
|
|
|
+ HA1B=`echo -n "$1@$2:$2:$3" | $CMDHASH | $AWK '{ print $1 }'`
|
|
if [ $? -ne 0 ] ; then
|
|
if [ $? -ne 0 ] ; then
|
|
echo "HA1B calculation failed"
|
|
echo "HA1B calculation failed"
|
|
exit 1
|
|
exit 1
|
|
@@ -800,7 +805,7 @@ _gen_ha1b()
|
|
_gen_phplib_id()
|
|
_gen_phplib_id()
|
|
{
|
|
{
|
|
NOW=`date`;
|
|
NOW=`date`;
|
|
- PHPLIB_ID=`echo -n "$1$2:$3:$NOW" | $MD5 | $AWK '{ print $1 }'`
|
|
|
|
|
|
+ PHPLIB_ID=`echo -n "$1$2:$3:$NOW" | $CMDHASH | $AWK '{ print $1 }'`
|
|
}
|
|
}
|
|
|
|
|
|
# params: user, password
|
|
# params: user, password
|