Browse Source

rclone: fix init script on CIDR format ipaddr

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
(cherry picked from commit 7af716f12d)
lilik-openwrt-22.03
Liangbin Lian 2 years ago
committed by Josef Schlehofer
parent
commit
b621a75f36
No known key found for this signature in database GPG Key ID: B950216FE4329F4C
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      net/rclone/files/rclone.init

+ 3
- 2
net/rclone/files/rclone.init View File

@ -47,12 +47,13 @@ start_service() {
config_get proxy_addr proxy proxy_addr config_get proxy_addr proxy proxy_addr
if [ "${addr_type}" = "local" ]; then if [ "${addr_type}" = "local" ]; then
addr="$(uci get network.loopback.ipaddr)"
addr="$(uci get network.loopback.ipaddr | cut -d' ' -f1)"
elif [ "${addr_type}" = "lan" ]; then elif [ "${addr_type}" = "lan" ]; then
addr="$(uci get network.lan.ipaddr)"
addr="$(uci get network.lan.ipaddr | cut -d' ' -f1)"
else else
addr="" addr=""
fi fi
addr="${addr%/*}"
local config_dir="${config_path%/*}" local config_dir="${config_path%/*}"
[ -d "$config_dir" ] || mkdir -p "$config_dir" [ -d "$config_dir" ] || mkdir -p "$config_dir"


Loading…
Cancel
Save