Skip to content

Instantly share code, notes, and snippets.

@amitkrout
Created June 29, 2022 16:33
Show Gist options
  • Select an option

  • Save amitkrout/11cd85d10bf54d6c5e4466d501f359b0 to your computer and use it in GitHub Desktop.

Select an option

Save amitkrout/11cd85d10bf54d6c5e4466d501f359b0 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Dict test"
declare -A appdomain_workflowID=(
["test-$1/$2"]="cow"
["test-$1/$2"]="dog"
["test-$1/$2"]="cat"
["test-$1/$2"]="fish"
)
declare -A appdomain_service=(
["ser1-Deploy"]="CO"
["ser2-Deploy"]="ho"
["ser3-Deploy"]="fd in"
["ser4-Deploy"]="nu"
)
for key in ${!appdomain_service[@]};
do
if [ $key == $2 ]
then
if grep -q "$3" <<< "${appdomain_service[$key]}"
then
echo "Service falls under correct AppDomain... Good to go"
else
echo "Service does not fall under correct AppDomain... Not good... Exiting"
exit 1
fi
fi
done
@amitkrout
Copy link
Author

$ ./dict.sh ST Mo install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment