Browse Source

Merge "Add script to delete host-only network interfaces"

Jenkins 3 years ago
parent
commit
ff30d0b06a
2 changed files with 62 additions and 1 deletions
  1. 32
    0
      actions/delete-interfaces.sh
  2. 30
    1
      clean.sh

+ 32
- 0
actions/delete-interfaces.sh View File

@@ -0,0 +1,32 @@
1
+#!/bin/bash
2
+# set -x
3
+
4
+#    Copyright 2015 Mirantis, Inc.
5
+#
6
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+#    not use this file except in compliance with the License. You may obtain
8
+#    a copy of the License at
9
+#
10
+#         http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+#    Unless required by applicable law or agreed to in writing, software
13
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+#    License for the specific language governing permissions and limitations
16
+#    under the License.
17
+#
18
+#    This script deletes host-only network interfaces.
19
+#
20
+
21
+# Include scripts with handy functions to operate VMs and VirtualBox networking
22
+source ./config.sh
23
+source ./functions/vm.sh
24
+source ./functions/network.sh
25
+
26
+# Delete host-only interfaces
27
+if [[ "$rm_network" == "0" ]]; then
28
+    delete_fuel_ifaces
29
+else
30
+    delete_all_hostonly_interfaces
31
+fi
32
+

+ 30
- 1
clean.sh View File

@@ -1,5 +1,34 @@
1 1
 #!/bin/bash
2 2
 
3
-# Shutdown installation and clean environment 
3
+#    Copyright 2015 Mirantis, Inc.
4
+#
5
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
6
+#    not use this file except in compliance with the License. You may obtain
7
+#    a copy of the License at
8
+#
9
+#         http://www.apache.org/licenses/LICENSE-2.0
10
+#
11
+#    Unless required by applicable law or agreed to in writing, software
12
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+#    License for the specific language governing permissions and limitations
15
+#    under the License.
16
+
17
+source ./functions/shell.sh
18
+
19
+# Add VirtualBox directory to PATH
20
+case "$(execute uname)" in
21
+    CYGWIN*)
22
+        vbox_path_registry=`execute cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Oracle/VirtualBox/InstallDir`
23
+        vbox_path=`execute cygpath "$vbox_path_registry"| sed -e 's%/$%%'`
24
+        export PATH=$PATH:$vbox_path
25
+      ;;
26
+    *)
27
+      ;;
28
+esac
29
+
30
+# Shutdown installation and clean environment
4 31
 ./actions/prepare-environment.sh || exit 1
5 32
 ./actions/clean-previous-installation.sh || exit 1
33
+./actions/delete-interfaces.sh || exit 1
34
+

Loading…
Cancel
Save