You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB
Bash

#!/bin/sh
#
# Copyright (C) 2011 OpenWrt.org
#
. /lib/functions.sh
OEMVARIANT=$(uci_get_state delos baptization OemVariant devolo)
DEVICETYPE=$(uci_get_state delos baptization DeviceType | tr 'a-z' 'A-Z')
MT=$(uci_get_state delos baptization MT)
CUSTFILE=/usr/share/delos-customization/variant-"$OEMVARIANT"/customization.sh
[ -f "$CUSTFILE" ] && . "$CUSTFILE"
set_baptized_customization() {
uci set customization.config.active_variant="$OEMVARIANT"
}
set_customized_names() {
local vendor_name=${_DVL_VENDOR_NAME:-devolo}
local vendor_url=${_DVL_VENDOR_URL:-http://www.devolo.de}
local product_name=$(eval echo \${_DVL_PRODUCT_NAME_MT${MT}})
[ -z "$product_name" ] && product_name=$(eval echo \${_DVL_PRODUCT_NAME_${DEVICETYPE}})
[ -z "$product_name" ] && product_name=${_DVL_PRODUCT_NAME:-Product}
uci set customization.info.vendor_name="$vendor_name"
uci set customization.info.vendor_url="$vendor_url"
uci set customization.info.product_name="$product_name"
}
set_baptized_customization
set_customized_names
uci commit customization
apply_customization.sh force
exit 0