From b621a75f36f15475bb2537c1d5522c673480e784 Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Fri, 5 Aug 2022 16:20:32 +0800 Subject: [PATCH] rclone: fix init script on CIDR format ipaddr Signed-off-by: Liangbin Lian (cherry picked from commit 7af716f12d7aeaef48ccc3f025927808af0bf461) --- net/rclone/files/rclone.init | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/rclone/files/rclone.init b/net/rclone/files/rclone.init index 51c0060f7..276a3b191 100755 --- a/net/rclone/files/rclone.init +++ b/net/rclone/files/rclone.init @@ -47,12 +47,13 @@ start_service() { config_get proxy_addr proxy proxy_addr 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 - addr="$(uci get network.lan.ipaddr)" + addr="$(uci get network.lan.ipaddr | cut -d' ' -f1)" else addr="" fi + addr="${addr%/*}" local config_dir="${config_path%/*}" [ -d "$config_dir" ] || mkdir -p "$config_dir"