mirror of
https://github.com/openwrt/packages.git
synced 2025-12-10 12:41:22 +00:00
pbr 1.2.1-r35 Makefile: * split uci-defaults into different purpose files * add handling of netifd integration Config: * update with default values for all options (thanks @betonmischer86) Init-script: * add netifd integration handling * add ip() function to emulate ip rule replace * add netbird intrfaces support (thanks @egc112) * reorganize loading/handling of options in load_package_config() * improve display of interface triggers in service_triggers() * remove chains cleanup from stop_service() due to exclusive use of fw4 nft files * improve status_service() output * drop input and postrouting as valid options for policy chain Uci-defaults files: * 91-pbr-nft: cosmetic improvements Default nft files: * drop use of input and postrouting chanins Custom User files: * dns-prefetch: functional improvements (thanks @betonmischer86) Signed-off-by: Stan Grishin <stangri@melmac.ca>
43 lines
1.6 KiB
Bash
43 lines
1.6 KiB
Bash
#!/bin/sh
|
|
# shellcheck disable=SC3043
|
|
|
|
readonly pbrFunctionsFile='/etc/init.d/pbr'
|
|
if [ -s "$pbrFunctionsFile" ]; then
|
|
# shellcheck source=../../etc/init.d/pbr
|
|
. "$pbrFunctionsFile"
|
|
else
|
|
printf "%b: pbr init.d file (%s) not found! \n" '\033[0;31mERROR\033[0m' "$pbrFunctionsFile"
|
|
fi
|
|
|
|
# Transition from older versions of pbr
|
|
sed -i "s/resolver_ipset/resolver_set/g" /etc/config/pbr
|
|
sed -i "s/'FORWARD'/'forward'/g" /etc/config/pbr
|
|
sed -i "s/'INPUT'/'input'/g" /etc/config/pbr
|
|
sed -i "s/'OUTPUT'/'output'/g" /etc/config/pbr
|
|
sed -i "s/'PREROUTING'/'prerouting'/g" /etc/config/pbr
|
|
sed -i "s/'POSTROUTING'/'postrouting'/g" /etc/config/pbr
|
|
sed -i "s/option fw_mask '0x\(.*\)'/option fw_mask '\1'/g" /etc/config/pbr
|
|
sed -i "s/option wan_mark '0x\(.*\)'/option wan_mark '\1'/g" /etc/config/pbr
|
|
sed -i "s|option path '/etc/pbr/|option path '/usr/share/pbr/|g" /etc/config/pbr
|
|
sed -i "/procd_lan_interface/d" /etc/config/pbr
|
|
sed -i "s|procd_lan_device|lan_device|g" /etc/config/pbr
|
|
sed -i "s|procd_wan_interface|uplink_interface|g" /etc/config/pbr
|
|
sed -i "s|procd_wan6_interface|uplink_interface6|g" /etc/config/pbr
|
|
sed -i "s|wan_ip_rules_priority|uplink_ip_rules_priority|g" /etc/config/pbr
|
|
sed -i "s|wan_mark|uplink_mark|g" /etc/config/pbr
|
|
|
|
# Transition from pre-1.1.7 versions
|
|
# shellcheck disable=SC2317,SC2329
|
|
_remove_wg_server_client() {
|
|
local path
|
|
config_get path "$1" 'path'
|
|
if [ "$path" = '/usr/share/pbr/pbr.user.wg_server_and_client' ]; then
|
|
uci_remove pbr "$1"
|
|
fi
|
|
}
|
|
config_load pbr
|
|
config_foreach _remove_wg_server_client include
|
|
[ -n "$(uci changes pbr)" ] && uci_commit pbr
|
|
|
|
exit 0
|