Gathering some ideas from Manoel's book and some other from the mesh central implementation, I modified the boards.txt and the platform.osx.txt, so I pass the ip address or ip name to the shell script to execute for the loader, so I can compile and transfer to different board.
My shell script looks like this.
---------------
#!/bin/sh
#
echo "starting download script"
echo "Args to shell:" $*
#
# ARG 1: Path to executable.
# ARG 2: Elf File to download
# ARG 3: Board name to use Galileo1, Galileo2, Edison1, ... as defined on /etc/hosts or ip address provided
#
#path may contain \ need to change all to /
path_to_exe=$1
fixed_path=${path_to_exe//\\/\/}
#
# Cleaning the sketch in /sketch folder
ssh root@$3'rm /sketch/sk*.elf; kill -9 $(pidof sketch.elf)'
#
#mv the downloaded file to /sketch/sketch.elf
echo "Moving downloaded file to /sketch/sketch.elf on target"
scp $2 root@$3:/sketch/sketch.elf
echo "Download to $3 done.."
# Giving permision to execute the new updloaded sketch
ssh root@$3'chmod a+x /sketch/sketch.elf; /opt/cln/galileo/galileo_sketch_reset_script.sh'
ssh root@$3'echo chmod and reset done..'
ssh root@$3'/sketch/sketch.elf /dev/null /dev/null &'
ssh root@$3'echo sketch gone ..'
echo "Transfer to $3 done.."
-----------------------