mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-09 06:33:52 -05:00
quote> quote> This changeset adjusts our references to the cloud.gov org we are using from gsa-tts-benefits-studio-prototyping to gsa-tts-benefits-studio. Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
68 lines
1.2 KiB
Bash
Executable File
68 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
org="gsa-tts-benefits-studio"
|
|
|
|
usage="
|
|
$0: Set egress rules for given space
|
|
|
|
Usage:
|
|
$0 -h
|
|
$0 -s <SPACE NAME> [-o <ORG NAME>] [-p] [-t]
|
|
|
|
Options:
|
|
-h: show help and exit
|
|
-s <SPACE NAME>: configure the space to act on. Required
|
|
-o <ORG NAME>: configure the organization to act on. Default: $org
|
|
-p: Add the public egress rules
|
|
-t: Add the trusted egress rules
|
|
|
|
Notes:
|
|
* If -p or -t are not passed, the related security groups will be removed, if they were present
|
|
"
|
|
|
|
set -e
|
|
|
|
space=""
|
|
public=false
|
|
trusted=false
|
|
|
|
while getopts ":hs:o:pt" opt; do
|
|
case "$opt" in
|
|
s)
|
|
space=${OPTARG}
|
|
;;
|
|
o)
|
|
org=${OPTARG}
|
|
;;
|
|
p)
|
|
public=true
|
|
;;
|
|
t)
|
|
trusted=true
|
|
;;
|
|
h)
|
|
echo "$usage"
|
|
exit 0
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ $space = "" ]]; then
|
|
echo "$usage"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $public = true ]]; then
|
|
cf bind-security-group public_networks_egress $org --space $space
|
|
else
|
|
cf unbind-security-group public_networks_egress $org $space
|
|
fi
|
|
|
|
if [[ $trusted = true ]]; then
|
|
cf bind-security-group trusted_local_networks_egress $org --space $space
|
|
else
|
|
cf unbind-security-group trusted_local_networks_egress $org $space
|
|
fi
|
|
|
|
echo "Done"
|