Commit 2d815626 authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: allow multiple occurrences of special strings is URLs

Substitude all occurrences of upper case strings like HOSTNAME, IPADDR and
MACADDR with the corresponding value. Before only first occurrence of each
was substituted
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 010a6246
......@@ -88,7 +88,7 @@ if [ "$CONFIG_DOTCONF_SOURCE_REMOTE" = "y" ] || [ "$CONFIG_DOTCONF_SOURCE_TRY_DH
fi
host_name=`hostname`
URL=$(echo $CONFIG_DOTCONF_URL | \
sed -e s/MACADDR/$macaddr/ -e s/IPADDR/$ipaddr/ -e s/HOSTNAME/$host_name/)
sed -e s/MACADDR/$macaddr/g -e s/IPADDR/$ipaddr/g -e s/HOSTNAME/$host_name/g)
# split the parts, as we need to handle tftp by hand
proto=$(echo $URL | cut -d: -f 1)
host=$(echo $URL | cut -d/ -f 3)
......
......@@ -60,7 +60,7 @@ start() {
fi
host_name=`hostname`
URL=$(echo $CONFIG_CUSTOM_BOOT_SCRIPT_SOURCE_REMOTE_URL | \
sed -e s/MACADDR/$macaddr/ -e s/IPADDR/$ipaddr/ -e s/HOSTNAME/$host_name/)
sed -e s/MACADDR/$macaddr/g -e s/IPADDR/$ipaddr/g -e s/HOSTNAME/$host_name/g)
# split the parts, as we need to handle tftp by hand
proto=$(echo $URL | cut -d: -f 1)
host=$(echo $URL | cut -d/ -f 3)
......
......@@ -118,7 +118,7 @@ elif [ "$CONFIG_PTP_REMOTE_CONF" = "y" ]; then
fi
host_name=`hostname`
URL=$(echo $CONFIG_PTP_CONF_URL | \
sed -e s/MACADDR/$macaddr/ -e s/IPADDR/$ipaddr/ -e s/HOSTNAME/$host_name/)
sed -e s/MACADDR/$macaddr/g -e s/IPADDR/$ipaddr/g -e s/HOSTNAME/$host_name/g)
# split the parts, as we need to handle tftp by hand
proto=$(echo $URL | cut -d: -f 1)
host=$(echo $URL | cut -d/ -f 3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment