~ajkavanagh/+junk/useful-things

« back to all changes in this revision

Viewing changes to scripts/delete-juju-security-groups.sh

  • Committer: Alex Kavanagh
  • Date: 2016-10-31 11:44:55 UTC
  • Revision ID: alex.kavanagh@canonical.com-20161031114455-sarb2po826cjwxxy
add delete juju security groups script

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
echo "Delete all of the juju named security groups?"
 
4
 
 
5
show-os-vars.sh
 
6
echo
 
7
read -r -p "Are you sure? [y/N] " response
 
8
response=${response,,}    # tolower
 
9
if [[ $response =~ ^(yes|y)$ ]]
 
10
then
 
11
        for id in $(openstack security group list -c ID -c Name -f value | grep "juju" | awk '{print $1}')
 
12
        do
 
13
                echo "Deleting group: $id"
 
14
                openstack security group delete $id
 
15
        done
 
16
fi