#!/bin/sh # Aurora Wi-Fi service (B8F). Started once by /init after the modem service; no OpenRC. # /etc/init.d/aurora-wifi start | stop | status — kernel cmdline 'aurora.wifi=off' disables autostart. C=/usr/sbin/aurora-wifi; D=/run/aurora-wifi; P=$D/service.pid; L=$D/service.log mkdir -p $D running() { [ -f $P ] && kill -0 $(cat $P) 2>/dev/null; } case "$1" in start) grep -qw aurora.wifi=off /proc/cmdline && { echo "aurora-wifi: disabled by cmdline"; exit 0; } running && { echo "aurora-wifi: start already in progress (pid $(cat $P))"; exit 0; } ( $C start >> $L 2>&1; echo "=== service start rc=$? $(cut -d' ' -f1 /proc/uptime)" >> $L ) & echo $! > $P; echo "aurora-wifi: starting (pid $!, log $L)";; stop) running && kill -TERM $(cat $P) 2>/dev/null; rm -f $P; $C stop;; status) running && echo "service: start in progress (pid $(cat $P))" || echo "service: idle"; $C status;; *) echo "usage: $0 start|stop|status"; exit 2;; esac