~ajkavanagh/+junk/useful-things

« back to all changes in this revision

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

  • Committer: Alex Kavanagh
  • Date: 2017-09-22 18:17:32 UTC
  • Revision ID: alex.kavanagh@canonical.com-20170922181732-13snyy8l8d02ewy2
Moved the scripts to vcsh-scripts for consistency

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