Files

24 lines
521 B
Bash
Raw Permalink Normal View History

2026-08-13 11:28:40 +08:00
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2026 AMLOGIC
# Get the RFKILL_STATE from the environment variable
RFKILL_STATE="${RFKILL_STATE}"
# Check the state
case "${RFKILL_STATE}" in
0)
echo "BT RFKILL switch is now OFF"
/bin/systemctl stop bluez &
;;
1)
echo "BT RFKILL switch is now ON"
2026-08-25 10:02:36 +08:00
echo 0 > /var/lib/systemd/rfkill/platform-fe078000.serial:bluetooth
/bin/systemctl restart bluez &
2026-08-13 11:28:40 +08:00
;;
*)
echo "Unknown RFKILL switch state: ${RFKILL_STATE}"
;;
esac