Signed-off-by: Van Waholtz <vanwaholtz@gmail.com>
$(INSTALL_CONF) ./files/$(2).config $(1)/etc/config/$(2)
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) ./files/$(2).init $(1)/etc/init.d/$(2)
+
+ if [ -r ./files/$(2).uci-defaults ]; then \
+ $(INSTALL_DIR) $(1)/etc/uci-defaults; \
+ $(INSTALL_DATA) ./files/$(2).uci-defaults $(1)/etc/uci-defaults/$(2); \
+ fi
endef
define Package/frp/template
option_cb() {
local option="$1"
local value="$2"
- echo "$option = $value" >> "$conf_file"
+ [ "$option" = "name" ] && \
+ sed -i "s/$CONFIG_SECTION/$value/g" "$conf_file" || \
+ echo "$option = $value" >> "$conf_file";
}
list_cb() {
local name="$1"
--- /dev/null
+#!/bin/sh
+
+. /lib/functions.sh
+
+upgrade() {
+ local section=$1
+ local name
+ [ "$section" != "common" ] || return 0
+ config_get name $section name
+ if [ -z "$name" ]; then
+ uci_set frpc "$section" name "$section"
+ uci_commit frpc
+ fi
+}
+
+config_load frpc
+config_foreach upgrade conf
+
+exit 0