Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes on ubus-lime-utils #1143

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
setup_hotspot_watchping() {
ifname="client-wwan"
gw=$(ip r show default dev $ifname | while read default via ip rest; do [[ $via == "via" ]] && echo $ip && break; done)
if [ -n gw ]; then
uci set system.hotspot_watchping=watchping
uci set system.hotspot_watchping.interface=$ifname
uci set system.hotspot_watchping.timeout=2m
uci set system.hotspot_watchping.pinghosts=$gw
uci set system.hotspot_watchping.pinginterval=20s
uci commit system
/etc/init.d/watchping restart
# check if interface exists before running the ip command on it
if [ -e /sys/class/net/$ifname/type ]; then
gw=$(ip r show default dev $ifname | while read default via ip rest; do [[ $via == "via" ]] && echo $ip && break; done)
if [ -n "$gw" ]; then
uci set system.hotspot_watchping=watchping
uci set system.hotspot_watchping.interface=$ifname
uci set system.hotspot_watchping.timeout=2m
uci set system.hotspot_watchping.pinghosts=$gw
uci set system.hotspot_watchping.pinginterval=20s
uci commit system
[ -e /etc/init.d/watchping ] && /etc/init.d/watchping restart
fi
fi
}

Expand Down
Loading