distribution/packages/jelos/sources/autostart/common/009-wifi
fewtarius 93a109ae93
* Fix get_setting to return the system setting if it exists but no game setting exists.
* Disable WIFI power save.
* Ensure the WIFI connection is refreshed on startup using wifictl.
2022-04-08 20:08:14 -04:00

22 lines
515 B
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
if [ "$(get_setting internal.wifi)" == 0 ] && [ "${DEVICE_INTERNAL_WIFI}" = true ]
then
nohup rmmod ${DEVICE_WIFI_MODULE} &
exit 0
else
set_setting internal.wifi 1
fi
if [ "$(get_setting wifi.enabled)" == "0" ] || [ "$1" == "disable" ]
then
nohup wifictl disable &
elif [ "$(get_setting wifi.enabled)" == "1" ] || [ "$1" == "enable" ]
then
nohup wifictl enable &
fi