From 984547cc1f9b5b622d496e07c5df343667f15fba Mon Sep 17 00:00:00 2001 From: Maksim Malchuk Date: Mon, 11 Jul 2016 15:17:23 +0300 Subject: [PATCH] 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 --- contrib/add-slave/add-slave-node-and-boot.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/add-slave/add-slave-node-and-boot.sh b/contrib/add-slave/add-slave-node-and-boot.sh index cb8bdc0..28587e8 100755 --- a/contrib/add-slave/add-slave-node-and-boot.sh +++ b/contrib/add-slave/add-slave-node-and-boot.sh @@ -23,6 +23,10 @@ source ./config.sh source ./functions/vm.sh source ./functions/network.sh +source ./functions/shell.sh + +# Add VirtualBox directory to PATH +add_virtualbox_path # Get variables "host_nic_name" for the slave node get_fuel_name_ifaces @@ -74,7 +78,7 @@ execute VBoxManage modifyvm $name --uart1 0x03f8 4 --uartmode1 disconnected # Add NIC1 MAC to description mac=$(execute VBoxManage showvminfo $name --machinereadable | grep '^macaddress1=' | cut -d'"' -f2) if [ -n "${mac}" ]; then - mac_address=$(echo $mac | sed 's/..\B/&:/g;s/./\L&/g') + mac_address=$(echo $mac | sed 's/.\{2\}/&:/g;s/:$//' | tr '[:upper:]' '[:lower:]') execute VBoxManage modifyvm $name --description "${mac}" fi