2023-09-04 14:54:35 +00:00
|
|
|
#!/bin/sh
|
2023-07-28 13:16:04 +00:00
|
|
|
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2023-12-17 14:52:08 +00:00
|
|
|
# Copyright (C) 2022-present JELOS (https://github.com/JustEnoughLinuxOS)
|
2023-07-28 13:16:04 +00:00
|
|
|
|
2023-10-11 16:09:10 +00:00
|
|
|
. /etc/profile.d/001-functions
|
2023-07-28 13:16:04 +00:00
|
|
|
|
2023-10-11 16:09:10 +00:00
|
|
|
# Get Internal Wifi State
|
|
|
|
INTERNAL_WIFI_STATE=$(get_setting "internal.wifi")
|
|
|
|
if [ ! -n "${INTERNAL_WIFI_STATE}" ]; then
|
|
|
|
INTERNAL_WIFI_STATE=1
|
|
|
|
set_setting "internal.wifi" "1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set export GPIO for Wifi and set state
|
2023-07-28 13:16:04 +00:00
|
|
|
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
|
2023-10-11 16:09:10 +00:00
|
|
|
echo ${INTERNAL_WIFI_STATE} > /sys/class/gpio/gpio${DEVICE_WIFI}/value
|
2023-07-28 13:16:04 +00:00
|
|
|
fi
|