2022-03-28 23:53:26 +00:00
|
|
|
#!/bin/bash
|
2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
|
|
|
|
|
|
|
. /etc/profile
|
|
|
|
|
2022-10-03 23:10:53 +00:00
|
|
|
HOSTNAME=$(get_setting system.hostname)
|
|
|
|
hostname ${HOSTNAME}
|
2022-03-05 17:33:17 +00:00
|
|
|
|
|
|
|
if [ "$(get_setting internal.wifi)" == 0 ] && [ "${DEVICE_INTERNAL_WIFI}" = true ]
|
|
|
|
then
|
2022-03-27 19:40:10 +00:00
|
|
|
nohup rmmod ${DEVICE_WIFI_MODULE} &
|
|
|
|
exit 0
|
2022-03-05 17:33:17 +00:00
|
|
|
else
|
|
|
|
set_setting internal.wifi 1
|
|
|
|
fi
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
if [ "$(get_setting wifi.enabled)" == "0" ] || [ "$1" == "disable" ]
|
|
|
|
then
|
2022-04-09 00:08:14 +00:00
|
|
|
nohup wifictl disable &
|
2022-02-05 14:23:32 +00:00
|
|
|
elif [ "$(get_setting wifi.enabled)" == "1" ] || [ "$1" == "enable" ]
|
|
|
|
then
|
2022-04-09 00:08:14 +00:00
|
|
|
nohup wifictl enable &
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|