check that broker is not running if export is used

This commit is contained in:
Marc Schoechlin 2015-06-30 08:16:52 +02:00
parent 06202097a2
commit b06c1679b6
2 changed files with 10 additions and 0 deletions

View File

@ -577,6 +577,11 @@ invoke_task(){
echo "Activemq is not running."
exit 1
fi
elif [ "$CHECKRUNNING" = "checkfornotrunning" ];then
if ( checkRunning );then
echo "Activemq is running."
exit 1
fi
fi
# call task in java binary
@ -656,6 +661,10 @@ case "$1" in
invoke_task checknotforrunning
exit $?
;;
export)
invoke_task checkfornotrunning
exit $?
;;
query|bstat|dstat|purge)
# Only check for a running broker if "--jmxurl" is part of the COMMANDLINE_ARGS
if (echo "$COMMANDLINE_ARGS"|grep -q -- "--jmxurl");then

View File

@ -143,6 +143,7 @@ assert ${STRATEGY} successful "${SCRIPT} start"
assert ${STRATEGY} failed "${SCRIPT}"
assert ${STRATEGY} successful "${SCRIPT} status"
echo "Sleeping 30 seconds to get activemq really started"; sleep 30
assert ${STRATEGY} failed "${SCRIPT} export"
assert ${STRATEGY} successful "${SCRIPT} status"
assert ${STRATEGY} successful "${SCRIPT} encrypt --password TESTPASSWORD --input FOOBAR|grep -q 'Encrypted text: '"
assert ${STRATEGY} successful "${SCRIPT} decrypt --input 'BkiT42A0CZfL1SanJIgxvQ==' --password asdasdasdasd|grep -q 'Decrypted text:'"