mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-01-28 01:27:16 +01:00
52 lines
1.4 KiB
Bash
52 lines
1.4 KiB
Bash
#!/bin/sh
|
|
# Copyright (C) 2014 Inteno Broadband Technology AB
|
|
# Author Mohamed Kallel <mohamed.kallel@pivasoftware.com>
|
|
|
|
prefix_list="$prefix_list InternetGatewayDevice.UPnP."
|
|
|
|
get_upnp_enable() {
|
|
local val=`$UCI_GET upnpd.config.enabled`
|
|
echo ${val:-1}
|
|
}
|
|
|
|
set_upnp_enable() {
|
|
local val="$1"
|
|
val=`echo $val|tr '[A-Z]' '[a-z]'`
|
|
if [ "$val" = "true" -o "$val" = "1" ]; then
|
|
$UCI_SET upnpd.config.enabled=1
|
|
elif [ "$val" = "false" -o "$val" = "0" ]; then
|
|
$UCI_SET upnpd.config.enabled=
|
|
else
|
|
return
|
|
fi
|
|
delay_service restart "miniupnpd" "1"
|
|
}
|
|
|
|
get_upnp_status() {
|
|
local val=`pidof miniupnpd`
|
|
[ "$val" = "" ] && echo "Down" || echo "Up"
|
|
}
|
|
|
|
get_cache_InternetGatewayDevice_UPnP() {
|
|
get_object_cache_generic "InternetGatewayDevice.UPnP." "0"
|
|
get_object_cache_generic "InternetGatewayDevice.UPnP.Device." "0"
|
|
get_param_cache_generic "InternetGatewayDevice.UPnP.Device.Enable" "1" "get_upnp_enable" "set_upnp_enable \$val" "" "xsd:boolean"
|
|
get_param_cache_generic "InternetGatewayDevice.UPnP.Device.X_INTENO_SE_Status" "0" "" "" "get_upnp_status"
|
|
}
|
|
|
|
get_dynamic_InternetGatewayDevice_UPnP() {
|
|
return $FAULT_CPE_NO_FAULT
|
|
}
|
|
|
|
get_dynamic_linker_InternetGatewayDevice_UPnP() {
|
|
return $FAULT_CPE_NO_FAULT
|
|
}
|
|
|
|
add_object_InternetGatewayDevice_UPnP() {
|
|
return $FAULT_CPE_INVALID_PARAMETER_NAME
|
|
}
|
|
|
|
delete_object_InternetGatewayDevice_UPnP() {
|
|
return $FAULT_CPE_INVALID_PARAMETER_NAME
|
|
}
|
|
|