Browse Source

Don't use Sed's GNU extension to support MacOSX

This change removes using the Sed's GNU extensions to support BSD-Sed
in MacOSX, also moves one of them (lowercase) to the tr command.

Change-Id: I5afef3fc562443e7089b72e645b725b86781c54c
Closes-Bug: #1600793
Signed-off-by: Maksim Malchuk <mmalchuk@mirantis.com>
tags/10.0.0rc1
Maksim Malchuk 2 years ago
parent
commit
984547cc1f
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      contrib/add-slave/add-slave-node-and-boot.sh

+ 5
- 1
contrib/add-slave/add-slave-node-and-boot.sh View File

@@ -23,6 +23,10 @@
23 23
 source ./config.sh
24 24
 source ./functions/vm.sh
25 25
 source ./functions/network.sh
26
+source ./functions/shell.sh
27
+
28
+# Add VirtualBox directory to PATH
29
+add_virtualbox_path
26 30
 
27 31
 # Get variables "host_nic_name" for the slave node
28 32
 get_fuel_name_ifaces
@@ -74,7 +78,7 @@ execute VBoxManage modifyvm $name --uart1 0x03f8 4 --uartmode1 disconnected
74 78
 # Add NIC1 MAC to description
75 79
 mac=$(execute VBoxManage showvminfo $name --machinereadable | grep '^macaddress1=' | cut -d'"' -f2)
76 80
 if [ -n "${mac}" ]; then
77
-  mac_address=$(echo $mac | sed 's/..\B/&:/g;s/./\L&/g')
81
+  mac_address=$(echo $mac | sed 's/.\{2\}/&:/g;s/:$//' | tr '[:upper:]' '[:lower:]')
78 82
   execute VBoxManage modifyvm $name --description "${mac}"
79 83
 fi
80 84
 

Loading…
Cancel
Save