blob: 49fd4f7dab94da9ea564b7fe55d28e9fac9d2959 [file] [log] [blame]
developercc441a02022-05-09 19:04:26 +08001require ccsp_common_filogic.inc
developer15a43312022-04-12 11:23:23 +08002
3FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
4
5EXTRA_OECONF += "PHP_RPATH=no"
6
7SRC_URI += "${CMF_GIT_ROOT}/rdkb/devices/raspberrypi/sysint;protocol=${CMF_GIT_PROTOCOL};branch=${CMF_GIT_BRANCH};destsuffix=git/devices;name=webuijst"
8SRCREV_webuijst = "${AUTOREV}"
9
10SRC_URI_append = " \
11 file://CcspWebUI.sh \
12 file://CcspWebUI.service \
13"
14inherit systemd
15do_install_append () {
16 install -d ${D}${sysconfdir}
17 install -d ${D}${base_libdir}/rdk/
18 install -d ${D}${systemd_unitdir}/system/
19
developercc441a02022-05-09 19:04:26 +080020 # delete wan0 reference for Filogic
21 sed -i "/wan0:80/a echo \"This interface is not available in Filogic\"" ${D}${sysconfdir}/webgui.sh
22 sed -i "/wan0:443/a echo \"This interface is not available in Filogic\"" ${D}${sysconfdir}/webgui.sh
developer15a43312022-04-12 11:23:23 +080023 sed -i "s/if \[ \"\$BOX_TYPE\" == \"HUB4\" \]/if \[ \"\$BOX_TYPE\" = \"HUB4\" \]/g" ${D}${sysconfdir}/webgui.sh
24 sed -i '/wan0/d' ${D}${sysconfdir}/webgui.sh
25
developercc441a02022-05-09 19:04:26 +080026 #delete server.pem reference for Filogic
27 sed -e '/server.pem/ s/^#*/echo "Removed server.pem references for Filogic"\n#/' -i ${D}${sysconfdir}/webgui.sh
developer15a43312022-04-12 11:23:23 +080028
29 install -m 755 ${WORKDIR}/CcspWebUI.sh ${D}${base_libdir}/rdk/
30 install -m 644 ${WORKDIR}/CcspWebUI.service ${D}${systemd_unitdir}/system/
31
32 sed -i '/Security.X_COMCAST-COM_KeyPassphrase/a \
33 \t\t\tsetStr("Device.DeviceInfo.X_RDKCENTRAL-COM_ConfigureWiFi", "false", true);' ${D}/usr/www2/actionHandler/ajaxSet_wireless_network_configuration_redirection.jst
34 sed -i "s/\$clients_RSSI\[strtoupper(\$Host\[\$i\.toString\(\)\]\['PhysAddress'\])\]/\$Host\[\$i\.toString\(\)\]\['X_CISCO_COM_RSSI'\]/g" ${D}/usr/www2/connected_devices_computers.jst
35 sed -i "s/\$wnStatus= (\$wan_enable==\"true\" \&\& \$wan_status==\"Down\") ? \"true\" : \"false\";/\$wnStatus= (\$wan_enable==\"true\" \&\& \$wan_status==\"Up\") ? \"true\" : \"false\";/g" ${D}/usr/www2/wan_network.jst
36 sed -i "s/if((!strcmp(\$url, \$Wan_IPv4) || ((inet_pton(\$url)!=\"\") || (inet_pton(\$Wan_IPv6!==\"\"))) \&\&(inet_pton(\$url) == inet_pton(\$Wan_IPv6)))){/if((!strcmp(\$url, \$Wan_IPv4) || ((inet_pton(\$url)!=\"\") \&\& (inet_pton(\$Wan_IPv6!==\"\"))) \&\&(inet_pton(\$url) == inet_pton(\$Wan_IPv6)))){/g" ${D}/usr/www2/index.jst
37 sed -i "s/\$Wan_IPv4 = getStr(\"Device.X_CISCO_COM_CableModem.IPAddress\");/\$Wan_IPv4 = getStr(\"Device.DeviceInfo.X_COMCAST-COM_CM_IP\");/g" ${D}/usr/www2/captiveportal.jst
38 sed -i "s/if((!strcmp(\$url, \$Wan_IPv4) || ((inet_pton(\$url)!=\"\") || (inet_pton(\$Wan_IPv6!==\"\"))) \&\&(inet_pton(\$url) == inet_pton(\$Wan_IPv6)))){/if((!strcmp(\$url, \$Wan_IPv4) || ((inet_pton(\$url)!=\"\") \&\& (inet_pton(\$Wan_IPv6!==\"\"))) \&\&(inet_pton(\$url) == inet_pton(\$Wan_IPv6)))){/g" ${D}/usr/www2/captiveportal.jst
39 sed -i '/\/\/ setStr("Device.WiFi.Radio."+\$r+".X_CISCO_COM_ApplySetting", "true", true);/ s/\/\///' ${D}/usr/www2/actionHandler/ajaxSet_wireless_network_configuration_edit.jst
40 sed -i "s/\/usr\/www/\/usr\/www2/g" ${D}${systemd_unitdir}/system/CcspWebUI.service
41}
42
43SYSTEMD_SERVICE_${PN} += "CcspWebUI.service"
44FILES_${PN} += "${systemd_unitdir}/system/CcspWebUI.service ${base_libdir}/rdk/*"