|
|
@ -19,7 +19,7 @@ else |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
daemon_start() { |
|
|
|
daemon_start() { |
|
|
|
case $OS in |
|
|
|
case "$OS" in |
|
|
|
"Alpine Linux"|postmarketOS) |
|
|
|
"Alpine Linux"|postmarketOS) |
|
|
|
sudo rc-service "$1" start |
|
|
|
sudo rc-service "$1" start |
|
|
|
;; |
|
|
|
;; |
|
|
@ -31,7 +31,7 @@ daemon_start() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
daemon_stop() { |
|
|
|
daemon_stop() { |
|
|
|
case $OS in |
|
|
|
case "$OS" in |
|
|
|
"Alpine Linux"|postmarketOS) |
|
|
|
"Alpine Linux"|postmarketOS) |
|
|
|
sudo rc-service "$1" stop |
|
|
|
sudo rc-service "$1" stop |
|
|
|
;; |
|
|
|
;; |
|
|
@ -43,7 +43,8 @@ daemon_stop() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
daemon_isrunning() { |
|
|
|
daemon_isrunning() { |
|
|
|
case $OS in |
|
|
|
daemon_exists "$1" || return 0 |
|
|
|
|
|
|
|
case "$OS" in |
|
|
|
"Alpine Linux"|postmarketOS) |
|
|
|
"Alpine Linux"|postmarketOS) |
|
|
|
rc-service "$1" status | grep -q started |
|
|
|
rc-service "$1" status | grep -q started |
|
|
|
;; |
|
|
|
;; |
|
|
@ -54,6 +55,17 @@ daemon_isrunning() { |
|
|
|
esac |
|
|
|
esac |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
daemon_exists() { |
|
|
|
|
|
|
|
case "$OS" in |
|
|
|
|
|
|
|
"Alpine Linux"|postmarketOS) |
|
|
|
|
|
|
|
[ -f /etc/init.d/"$1" ] |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
"Arch Linux ARM"|alarm) |
|
|
|
|
|
|
|
systemctl status "$1" >/dev/null |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
esac |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ensure_daemon() { |
|
|
|
ensure_daemon() { |
|
|
|
TRIES=0 |
|
|
|
TRIES=0 |
|
|
|
while ! daemon_isrunning "$1"; do |
|
|
|
while ! daemon_isrunning "$1"; do |
|
|
@ -69,7 +81,8 @@ ensure_daemon() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ensure_daemons() { |
|
|
|
ensure_daemons() { |
|
|
|
if (daemon_isrunning eg25-manager) && (daemon_isrunning modemmanager); then |
|
|
|
if (daemon_isrunning eg25-manager) && \ |
|
|
|
|
|
|
|
(daemon_isrunning modemmanager); then |
|
|
|
return |
|
|
|
return |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|