#!/bin/sh
# substitute the configured Cypress-IoT domain name into 
# the /etc/opkg/base-feeds.conf file
#

# lookup cypress-iot url
host=$(/usr/bin/cmd get iot.cypress_iot.url|awk -F: '{ print $2 }'|awk -F '"' '{print $2}')
rc=$(/bin/sed -i "s://.*/files://${host}/files:g" /etc/opkg/base-feeds.conf)
echo $rc > /etc/opkg/BASE_FEEDS_SET