Created
January 19, 2019 03:59
-
-
Save Gowee/32a7db32c7680a543b446e77fe2a34bb to your computer and use it in GitHub Desktop.
openwrt /etc/init.d/relayd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3a4,5 | |
> . $IPKG_INSTROOT/lib/functions/network.sh | |
> | |
45a48 | |
> local dhcp_ipaddr | |
47a51,64 | |
> config_get proto "$net" proto | |
> [ "$proto" = "dhcp" ] && { | |
> local addrs | |
> network_get_ipaddr addrs "$net" | |
> for addr in $addrs; do | |
> [ ! -z "$dhcp_ipaddr" ] && \ | |
> logger "Ignoring addr $addr" \ | |
> -t relayd -p warning \ | |
> && continue | |
> dhcp_ipaddr="$addr" | |
> logger "finds dhcp ipaddr $dhcp_ipaddr" \ | |
> -t relayd -p info | |
> done | |
> } | |
52c69 | |
< | |
--- | |
> | |
69c86,87 | |
< config_get ipaddr "$cfg" ipaddr | |
--- | |
> config_get ipaddr "$cfg" ipaddr "$dhcp_ipaddr" | |
> logger "ipaddr is $ipaddr finally" -t relayd -p info |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment