wifibroadcast-ng: check for process on startup

pull/1696/head
viktorxda 2025-02-01 15:30:13 +01:00
parent 30f33430e8
commit a07a4082e8
2 changed files with 317 additions and 317 deletions

View File

@ -5,7 +5,8 @@ wfb_dev=wlan0
wfb_yaml() {
if [ -e "$1" ]; then
while IFS=: read -r key value; do
value=$(eval echo $value)
key=$(eval echo "$key")
value=$(eval echo "$value")
export "$key=$value"
done < "$1"
fi
@ -129,6 +130,7 @@ start() {
killall -1 majestic
fi
stop
start_broadcast
start_tunnel
start_telemetry
@ -136,7 +138,10 @@ start() {
stop() {
for process in wfb_rx wfb_tx wfb_tun msposd mavfwd; do
killall -q "$process"
if [ -n "$(pidof $process)" ]; then
echo "- Stopping $process"
killall -q "$process"
fi
done
}
@ -145,11 +150,6 @@ case "$1" in
$1
;;
restart|reload)
stop
start
;;
reset)
cp -f /rom/etc/majestic.yaml /etc/majestic.yaml
cp -f /rom/etc/wfb.yaml /etc/wfb.yaml
@ -157,7 +157,7 @@ case "$1" in
;;
*)
echo "Usage: $0 {start|stop|restart|reload|reset}"
echo "Usage: $0 {start|stop|reset}"
exit 1
;;
esac

View File

@ -286,7 +286,7 @@
if (configData.wfb) {
syncForm(configData.wfb, 'wfb', "update");
uploadYAML(configData.wfb, '/etc/wfb.yaml');
executeDelay(this, 'wifibroadcast restart');
executeDelay(this, 'wifibroadcast start');
}
});