Skip to content

Commit

Permalink
removed group-password from cluster.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
hasancelik committed Sep 13, 2018
1 parent 958aa11 commit 1f6b04f
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions hazelcast/src/main/resources/cluster.sh
Expand Up @@ -7,7 +7,6 @@ if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
echo " -a, --address : Defines which ip address hazelcast is running. Default value is '127.0.0.1'."
echo " -p, --port : Defines which port hazelcast is running. Default value is '5701'."
echo " -g, --groupname : Defines groupname of the cluster. Default value is 'dev'."
echo " -P, --password : Defines password of the cluster. Default value is 'dev-pass'."
echo " -v, --version : Defines the cluster version to change to. To be used in conjunction with '-o change-cluster-version'."
exit 0
fi
Expand All @@ -31,10 +30,6 @@ case "$key" in
-g|--groupname)
GROUPNAME="$2"
shift # past argument
;;
-P|--password)
PASSWORD="$2"
shift # past argument
;;
-a|--address)
ADDRESS="$2"
Expand Down Expand Up @@ -64,11 +59,6 @@ if [ -z "$GROUPNAME" ]; then
GROUPNAME="dev"
fi

if [ -z "$PASSWORD" ]; then
echo "No password is defined, running script with default password: 'dev-pass'."
PASSWORD="dev-pass"
fi

if [ -z "$ADDRESS" ]; then
echo "No specific ip address is defined, running script with default ip: '127.0.0.1'."
ADDRESS="127.0.0.1"
Expand All @@ -84,7 +74,7 @@ fi
if [ "$OPERATION" = "get-state" ]; then
echo "Getting cluster state on ip ${ADDRESS} on port ${PORT}"
request="http://${ADDRESS}:${PORT}/hazelcast/rest/management/cluster/state"
response=$(curl --data "${GROUPNAME}&${PASSWORD}" --silent "${request}");
response=$(curl --data "${GROUPNAME}" --silent "${request}");
STATUS=$(echo "${response}" | sed -e 's/^.*"status"[ ]*:[ ]*"//' -e 's/".*//');
if [ "$STATUS" = "fail" ];then
echo "An error occurred while listing!";
Expand Down Expand Up @@ -117,7 +107,7 @@ if [ "$OPERATION" = "change-state" ]; then

echo "Changing cluster state to ${STATE} on ip ${ADDRESS} on port ${PORT}"
request="http://${ADDRESS}:${PORT}/hazelcast/rest/management/cluster/changeState"
response=$(curl --data "${GROUPNAME}&${PASSWORD}&${STATE}" --silent "${request}");
response=$(curl --data "${GROUPNAME}&${STATE}" --silent "${request}");
STATUS=$(echo "${response}" | sed -e 's/^.*"status"[ ]*:[ ]*"//' -e 's/".*//');

if [ "$STATUS" = "fail" ];then
Expand Down Expand Up @@ -150,7 +140,7 @@ if [ "$OPERATION" = "force-start" ]; then
echo "Starting cluster from member on ip ${ADDRESS} on port ${PORT}"

request="http://${ADDRESS}:${PORT}/hazelcast/rest/management/cluster/forceStart"
response=$(curl --data "${GROUPNAME}&${PASSWORD}" --silent "${request}");
response=$(curl --data "${GROUPNAME}" --silent "${request}");
STATUS=$(echo "${response}" | sed -e 's/^.*"status"[ ]*:[ ]*"//' -e 's/".*//');

if [ "$STATUS" = "fail" ];then
Expand All @@ -177,7 +167,7 @@ if [ "$OPERATION" = "partial-start" ]; then
echo "Starting cluster from member on ip ${ADDRESS} on port ${PORT}"

request="http://${ADDRESS}:${PORT}/hazelcast/rest/management/cluster/partialStart"
response=$(curl --data "${GROUPNAME}&${PASSWORD}" --silent "${request}");
response=$(curl --data "${GROUPNAME}" --silent "${request}");
STATUS=$(echo "${response}" | sed -e 's/^.*"status"[ ]*:[ ]*"//' -e 's/".*//');

if [ "$STATUS" = "fail" ];then
Expand Down Expand Up @@ -205,7 +195,7 @@ if [ "$OPERATION" = "shutdown" ]; then
echo "Shutting down from member on ip ${ADDRESS} on port ${PORT}"

request="http://${ADDRESS}:${PORT}/hazelcast/rest/management/cluster/clusterShutdown"
response=$(curl --data "${GROUPNAME}&${PASSWORD}" --silent "${request}");
response=$(curl --data "${GROUPNAME}" --silent "${request}");
STATUS=$(echo "${response}" | sed -e 's/^.*"status"[ ]*:[ ]*"//' -e 's/".*//');

if [ "$STATUS" = "fail" ];then
Expand Down Expand Up @@ -258,7 +248,7 @@ if [ "$OPERATION" = "change-cluster-version" ]; then

echo "Changing cluster version to ${CLUSTER_VERSION} on ip ${ADDRESS} on port ${PORT}"
request="http://${ADDRESS}:${PORT}/hazelcast/rest/management/cluster/version"
response=$(curl --data "${GROUPNAME}&${PASSWORD}&${CLUSTER_VERSION}" --silent "${request}");
response=$(curl --data "${GROUPNAME}&${CLUSTER_VERSION}" --silent "${request}");
STATUS=$(echo "${response}" | sed -e 's/^.*"status"[ ]*:[ ]*"//' -e 's/".*//');

if [ "$STATUS" = "fail" ];then
Expand Down

0 comments on commit 1f6b04f

Please sign in to comment.