mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-30 18:07:52 +00:00
WIFI-2416 Automatically get redirector from DigiCert
Signed-off-by: Rick Sommerville <rick.sommerville@netexperience.com>
This commit is contained in:
@@ -25,12 +25,21 @@ if [ -z "$1" ]; then
|
|||||||
"https://${DIGICERT_API_URI}/iot/api/v2/device/${digicert_device_id}"`
|
"https://${DIGICERT_API_URI}/iot/api/v2/device/${digicert_device_id}"`
|
||||||
|
|
||||||
controller_url=`echo ${device_data} | jsonfilter -e '@.fields[@.name="Redirector"].value'`
|
controller_url=`echo ${device_data} | jsonfilter -e '@.fields[@.name="Redirector"].value'`
|
||||||
# TODO: we should get the port with the redirector record and only default to 6643 if no port was specified
|
if [ -z "$controller_url" ]; then
|
||||||
redirector_addr="ssl:${controller_url}:6643"
|
echo "No redirector found for this device"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
controller_port=`echo ${controller_url} | cut -d ":" -f2)`
|
||||||
|
if [ -z "$controller_port" ]; then
|
||||||
|
redirector_addr="ssl:${controller_url}:6643"
|
||||||
|
else
|
||||||
|
redirector_addr="ssl:${controller_url}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
redirector_addr=$1
|
redirector_addr=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
uci set system.tip.redirector="${redirector_addr}"
|
uci set system.tip.redirector="${redirector_addr}"
|
||||||
|
uci set system.tip.deployed=0
|
||||||
uci commit system
|
uci commit system
|
||||||
/etc/init.d/opensync restart
|
/etc/init.d/opensync restart
|
||||||
|
|||||||
@@ -37,6 +37,14 @@ start_service() {
|
|||||||
echo "Setting certificates"
|
echo "Setting certificates"
|
||||||
mkdir -p ${CERTS_DEST_PATH}
|
mkdir -p ${CERTS_DEST_PATH}
|
||||||
cp ${CERTS_SRC_PATH}/* ${CERTS_DEST_PATH}/
|
cp ${CERTS_SRC_PATH}/* ${CERTS_DEST_PATH}/
|
||||||
|
echo "Checking Redirector"
|
||||||
|
redirector=$(uci get system.tip.redirector)
|
||||||
|
if [ -z "$redirector" ]; then
|
||||||
|
logger -t opensync "Contacting DigiCert for redirector address"
|
||||||
|
wlan_ap_redirector.sh
|
||||||
|
else
|
||||||
|
logger -t opensync "Redirector address is ${redirector}"
|
||||||
|
fi
|
||||||
echo "Starting OpenSync"
|
echo "Starting OpenSync"
|
||||||
procd_set_param command ${PROG}
|
procd_set_param command ${PROG}
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
|
|||||||
Reference in New Issue
Block a user