distribution/packages/jelos/autostart/008-network

27 lines
578 B
Text
Raw Normal View History

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
tocon "Configuring network..."
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" ]
2022-02-05 14:23:32 +00:00
then
nohup wifictl disable &
elif [ "$(get_setting network.enabled)" == "1" ] || [ "$1" == "enable" ]
2022-02-05 14:23:32 +00:00
then
nohup wifictl enable &
2022-02-05 14:23:32 +00:00
fi