distribution/packages/jelos/sources/autostart/common/009-wifi

21 lines
496 B
Bash
Executable file

#!/bin/sh
# 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
rmmod ${DEVICE_WIFI_MODULE}
else
set_setting internal.wifi 1
fi
if [ "$(get_setting wifi.enabled)" == "0" ] || [ "$1" == "disable" ]
then
connmanctl disable wifi
elif [ "$(get_setting wifi.enabled)" == "1" ] || [ "$1" == "enable" ]
then
connmanctl enable wifi
fi