Files
Peter Seiderer f38453f00e package/iwd: suppress S40iwd shellcheck warnings
- suppress S40iwd shellcheck warnings:

  In package/iwd/S40iwd line 8:
  [ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
                                     ^--------------------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.

  In package/iwd/S40iwd line 15:
  		-- $IWD_ARGS
                     ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

- remove package/iwd/S40iwd from .checkpackageignore

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2026-01-06 22:53:55 +01:00

46 lines
793 B
Bash

#!/bin/sh
DAEMON="iwd"
PIDFILE="/var/run/$DAEMON.pid"
IWD_ARGS=""
# shellcheck source=/dev/null
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
start() {
printf 'Starting %s: ' "$DAEMON"
mkdir -p /tmp/iwd/hotspot
# shellcheck disable=SC2086 # we need the word splitting
start-stop-daemon --start --background --make-pidfile \
--pidfile "$PIDFILE" --exec "/usr/libexec/$DAEMON" \
-- $IWD_ARGS
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
stop() {
printf 'Stopping %s: ' "$DAEMON"
start-stop-daemon --stop --quiet --pidfile "$PIDFILE"
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
case "$1" in
start|stop)
"$1";;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac