mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 13:46:32 +00:00
properly test ppp connection availability
This commit is contained in:
parent
d7d08cb07d
commit
246e788328
@ -28,7 +28,7 @@ test -n "$os_debug" || source /etc/init.d/conf
|
||||
test "$os_networkless" == "true" && exit 0
|
||||
|
||||
connected() {
|
||||
ifconfig | grep $os_ppp &>/dev/null 2>&1 && return 0 || return 1
|
||||
ifconfig | grep $os_ppp &>/dev/null && return 0 || return 1
|
||||
}
|
||||
|
||||
watch() {
|
||||
|
@ -170,7 +170,7 @@ start() {
|
||||
ssid=$(cat /data/etc/wpa_supplicant.conf 2>&1 | grep ssid | grep -v scan_ssid | cut -d '"' -f 2)
|
||||
test -n "$ssid" && start_wlan && wlan_ok="ok"
|
||||
|
||||
test -r /data/etc/ppp/modem && ppp_ok="ok" # TODO actually test the ppp link
|
||||
test -r /data/etc/ppp/modem && ifconfig | grep $os_ppp &>/dev/null && ppp_ok="ok"
|
||||
|
||||
# if wifi or ppp link ok, start eth in background
|
||||
if [ "$wlan_ok" == "ok" ] || [ "$ppp_ok" == "ok" ]; then
|
||||
@ -181,11 +181,11 @@ start() {
|
||||
|
||||
if [ "$eth_ok" != "ok" ] && [ "$wlan_ok" != "ok" ] && [ "$ppp_ok" != "ok" ]; then
|
||||
if [ "$link_watch" == "true" ]; then
|
||||
logger -t ethernet -s "no network connection available, rebooting"
|
||||
logger -t network -s "no network connection available, rebooting"
|
||||
reboot
|
||||
return 1
|
||||
else
|
||||
logger -t ethernet -s "no network connection available"
|
||||
logger -t network -s "no network connection available"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user