mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 14:16:31 +00:00
refuse to start without a network connection
This commit is contained in:
parent
1a76a44a3c
commit
dca861266c
@ -79,7 +79,6 @@ start() {
|
|||||||
|
|
||||||
if [ $count -gt $link_watch_timeout ] || ! pidof wpa_supplicant > /dev/null; then
|
if [ $count -gt $link_watch_timeout ] || ! pidof wpa_supplicant > /dev/null; then
|
||||||
msg_fail
|
msg_fail
|
||||||
reboot
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -119,5 +118,7 @@ case "$1" in
|
|||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit $?
|
# continue after an unsuccessfull wifi start
|
||||||
|
# as we may still have an ethernet connection available
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ start_eth() {
|
|||||||
count=$(($count + 1))
|
count=$(($count + 1))
|
||||||
if [ $count -ge 3 ]; then
|
if [ $count -ge 3 ]; then
|
||||||
msg_done "no device"
|
msg_done "no device"
|
||||||
return
|
return 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ start_eth() {
|
|||||||
count=$(($count + 1))
|
count=$(($count + 1))
|
||||||
if [ $count -ge 3 ]; then
|
if [ $count -ge 3 ]; then
|
||||||
msg_done "no link"
|
msg_done "no link"
|
||||||
return
|
return 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ start_eth() {
|
|||||||
count=$(($count + 1))
|
count=$(($count + 1))
|
||||||
if [ $count -ge $link_nego_timeout ]; then
|
if [ $count -ge $link_nego_timeout ]; then
|
||||||
msg_done "no link"
|
msg_done "no link"
|
||||||
return
|
return 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -157,13 +157,20 @@ start() {
|
|||||||
|
|
||||||
start_lo
|
start_lo
|
||||||
|
|
||||||
test -n "$ssid" && start_wlan
|
test -n "$ssid" && start_wlan && wlan_ok="ok"
|
||||||
|
|
||||||
# if wifi or ppp connection configured, start eth in background
|
test -r /data/etc/ppp/modem && ppp_ok="ok" # TODO actually test the ppp link
|
||||||
if [ -n "$ssid" ] || [ -r /data/etc/ppp/modem ]; then
|
|
||||||
|
# if wifi or ppp link ok, start eth in background
|
||||||
|
if [ "$wlan_ok" == "ok" ] || [ "$ppp_ok" == "ok" ]; then
|
||||||
start_eth &>/dev/null &
|
start_eth &>/dev/null &
|
||||||
else
|
else
|
||||||
start_eth
|
start_eth && eth_ok="ok"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$eth_ok" != "ok" ] && [ "$wlan_ok" != "ok" ] && [ "$ppp_ok" != "ok" ]; then
|
||||||
|
reboot
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$static_gw" ]; then
|
if [ -n "$static_gw" ]; then
|
||||||
|
@ -12,7 +12,7 @@ echo "---- shutting down $os_name $os_version ----" >> $boot_log
|
|||||||
(for i in $(ls -r /etc/init.d/S??*); do
|
(for i in $(ls -r /etc/init.d/S??*); do
|
||||||
[ ! -x "$i" ] && continue
|
[ ! -x "$i" ] && continue
|
||||||
[ -f /data/etc/no_$(basename $i) ] && continue
|
[ -f /data/etc/no_$(basename $i) ] && continue
|
||||||
$i stop
|
$i stop || break
|
||||||
done& echo $! > $pid_file) | tee -a $boot_log &
|
done& echo $! > $pid_file) | tee -a $boot_log &
|
||||||
|
|
||||||
pid=$(cat $pid_file)
|
pid=$(cat $pid_file)
|
||||||
|
@ -13,7 +13,7 @@ echo "---- booting $os_name $os_version----" >> $tmp_boot_log
|
|||||||
(for i in /etc/init.d/S??*; do
|
(for i in /etc/init.d/S??*; do
|
||||||
[ ! -x "$i" ] && continue
|
[ ! -x "$i" ] && continue
|
||||||
[ -f /data/etc/no_$(basename $i) ] && continue
|
[ -f /data/etc/no_$(basename $i) ] && continue
|
||||||
$i start
|
$i start || break
|
||||||
done& echo $! > $pid_file) | tee -a $tmp_boot_log &
|
done& echo $! > $pid_file) | tee -a $tmp_boot_log &
|
||||||
|
|
||||||
pid=$(cat $pid_file)
|
pid=$(cat $pid_file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user