2023-10-11 16:09:10 +00:00
|
|
|
#!/bin/bash
|
2023-10-23 22:44:47 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2023-10-11 16:09:10 +00:00
|
|
|
|
|
|
|
. /etc/profile
|
|
|
|
|
|
|
|
# Set export gpio for wifi and enable
|
|
|
|
if [ ! -d "/sys/class/gpio/gpio${DEVICE_WIFI}" ]; then
|
|
|
|
echo ${DEVICE_WIFI} > /sys/class/gpio/export
|
|
|
|
echo out > /sys/class/gpio/gpio${DEVICE_WIFI}/direction
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set wifi gpio state
|
|
|
|
case $1 in
|
|
|
|
disable)
|
|
|
|
echo 0 > /sys/class/gpio/gpio${DEVICE_WIFI}/value
|
|
|
|
set_setting internal.wifi 0
|
|
|
|
;;
|
|
|
|
enable)
|
|
|
|
echo 1 > /sys/class/gpio/gpio${DEVICE_WIFI}/value
|
|
|
|
set_setting internal.wifi 1
|
|
|
|
;;
|
|
|
|
esac
|