mirror of
https://github.com/MengMengCode/VoCat.git
synced 2026-08-13 03:13:43 +08:00
Wait for OpenWrt service shutdown during upgrades
This commit is contained in:
@@ -410,6 +410,18 @@ write_service() {
|
|||||||
enable_and_start() {
|
enable_and_start() {
|
||||||
if [ -x "$OPENWRT_INIT_PATH" ] && { [ -x /sbin/procd ] || [ -x /sbin/ubusd ]; }; then
|
if [ -x "$OPENWRT_INIT_PATH" ] && { [ -x /sbin/procd ] || [ -x /sbin/ubusd ]; }; then
|
||||||
"$OPENWRT_INIT_PATH" enable
|
"$OPENWRT_INIT_PATH" enable
|
||||||
|
# Stop explicitly before restart. Some procd/rc.common variants return
|
||||||
|
# from restart while the previous process is still inside its bounded
|
||||||
|
# VoWiFi cleanup, so the replacement can race the host-wide instance
|
||||||
|
# lock and enter a respawn cycle.
|
||||||
|
"$OPENWRT_INIT_PATH" stop || true
|
||||||
|
local stop_attempt
|
||||||
|
for stop_attempt in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40; do
|
||||||
|
if ! "$OPENWRT_INIT_PATH" running; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
if "$OPENWRT_INIT_PATH" restart; then
|
if "$OPENWRT_INIT_PATH" restart; then
|
||||||
# Modems may need several seconds to release and reopen their AT
|
# Modems may need several seconds to release and reopen their AT
|
||||||
# port after procd stops the previous process. Require consecutive
|
# port after procd stops the previous process. Require consecutive
|
||||||
|
|||||||
Reference in New Issue
Block a user