Browse Source

Use BSD's 'sed' regexp on MacOSX

VirtualBox scripts tested well only with GNU version of the
'sed', but MacOSX systems without custom brew-installed
packages contain BSD's version of the sed. This commit
fixes regexp to use both versions.

Change-Id: I058cac4eb9c2beefffc20ad05a47bc1d8ed2169d
Closes-Bug: #1537822
Maksim Malchuk 3 years ago
parent
commit
ddeb2f866a
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      functions/network.sh
  2. 1
    1
      functions/vm.sh

+ 2
- 2
functions/network.sh View File

@@ -19,7 +19,7 @@
19 19
 source ./functions/shell.sh
20 20
 
21 21
 get_hostonly_interfaces() {
22
-  local ifaces=`execute VBoxManage list hostonlyifs | egrep '^Name' | sed 's/^Name\:\s*//' | uniq | tr "\\n" ","`
22
+  local ifaces=`execute VBoxManage list hostonlyifs | egrep '^Name' | sed 's/^Name\:[ \t]*//' | uniq | tr "\\n" ","`
23 23
   echo -e "${ifaces}"
24 24
 }
25 25
 
@@ -33,7 +33,7 @@ get_fuel_ifaces() {
33 33
     fuel_networks+="$fuel_network "
34 34
   done
35 35
   for ip in $fuel_networks; do
36
-    fuel_iface=`execute VBoxManage list hostonlyifs | egrep -B3 $ip | egrep '^Name' | sed 's/^Name\:\s*//' | uniq | tr "\\n" ","`
36
+    fuel_iface=`execute VBoxManage list hostonlyifs | egrep -B3 $ip | egrep '^Name' | sed 's/^Name\:[ \t]*//' | uniq | tr "\\n" ","`
37 37
     fuel_ifaces+="$fuel_iface"
38 38
   done
39 39
   echo $fuel_ifaces

+ 1
- 1
functions/vm.sh View File

@@ -19,7 +19,7 @@
19 19
 source ./functions/shell.sh
20 20
 
21 21
 get_vm_base_path() {
22
-    echo `execute VBoxManage list systemproperties | egrep '^Default machine folder' | sed 's/^Default machine folder\:\s*//'`
22
+    echo `execute VBoxManage list systemproperties | egrep '^Default machine folder' | sed 's/^Default machine folder\:[ \t]*//'`
23 23
 }
24 24
 
25 25
 get_vms_running() {

Loading…
Cancel
Save