Browse Source

frpc: add anonymous proxy config support

Signed-off-by: Van Waholtz <vanwaholtz@gmail.com>
lilik-openwrt-22.03
Van Waholtz 3 years ago
committed by Rosen Penev
parent
commit
30d8431b71
3 changed files with 27 additions and 1 deletions
  1. +5
    -0
      net/frp/Makefile
  2. +3
    -1
      net/frp/files/frpc.init
  3. +19
    -0
      net/frp/files/frpc.uci-defaults

+ 5
- 0
net/frp/Makefile View File

@ -33,6 +33,11 @@ define Package/frp/install
$(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


+ 3
- 1
net/frp/files/frpc.init View File

@ -21,7 +21,9 @@ config_cb() {
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"


+ 19
- 0
net/frp/files/frpc.uci-defaults View 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…
Cancel
Save