distribution/packages/sysutils/autostart/sources/common/008-network

24 lines
546 B
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
HOSTNAME=$(get_setting system.hostname)
hostname ${HOSTNAME}
avahi-set-host-name ${HOSTNAME}
NETCHECK=$(systemctl status connman >/dev/null 2>&1)
if [ "$?" = "0" ]
then
systemctl stop connman
fi
if [ "$(get_setting network.enabled)" == "0" ] || [ "$1" == "disable" ]
then
nohup wifictl disable &
elif [ "$(get_setting network.enabled)" == "1" ] || [ "$1" == "enable" ]
then
nohup wifictl enable &
fi