frpc: add anonymous proxy config support
Signed-off-by: Van Waholtz <vanwaholtz@gmail.com>
This commit is contained in:
parent
0238bcef19
commit
30d8431b71
3 changed files with 27 additions and 1 deletions
|
@ -33,6 +33,11 @@ define Package/frp/install
|
||||||
$(INSTALL_CONF) ./files/$(2).config $(1)/etc/config/$(2)
|
$(INSTALL_CONF) ./files/$(2).config $(1)/etc/config/$(2)
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||||
$(INSTALL_BIN) ./files/$(2).init $(1)/etc/init.d/$(2)
|
$(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
|
endef
|
||||||
|
|
||||||
define Package/frp/template
|
define Package/frp/template
|
||||||
|
|
|
@ -21,7 +21,9 @@ config_cb() {
|
||||||
option_cb() {
|
option_cb() {
|
||||||
local option="$1"
|
local option="$1"
|
||||||
local value="$2"
|
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() {
|
list_cb() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
|
|
19
net/frp/files/frpc.uci-defaults
Normal file
19
net/frp/files/frpc.uci-defaults
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/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
|
Loading…
Reference in a new issue