diff --git a/packages/jelos/autostart/008-network b/packages/jelos/autostart/008-network index 7ea722b5b..1bd7c8db1 100755 --- a/packages/jelos/autostart/008-network +++ b/packages/jelos/autostart/008-network @@ -6,15 +6,6 @@ tocon "Configuring network..." -HOSTNAME=$(get_setting system.hostname) -hostname ${HOSTNAME} -avahi-set-host-name ${HOSTNAME} - -for service in connman wpa_supplicant -do - systemctl restart ${service} -done - if [ "$(get_setting network.enabled)" == "0" ] || [ "$1" == "disable" ] then nohup wifictl disable & diff --git a/packages/jelos/system.d/jelos-autostart.service b/packages/jelos/system.d/jelos-autostart.service index 4a36abc00..04d118805 100644 --- a/packages/jelos/system.d/jelos-autostart.service +++ b/packages/jelos/system.d/jelos-autostart.service @@ -1,7 +1,7 @@ [Unit] Description=JELOS user autostart script Before=emulationstation.service -After=graphical.target +After=network-base.service graphical.target [Service] Type=oneshot diff --git a/packages/sysutils/systemd/scripts/network-base-setup b/packages/sysutils/systemd/scripts/network-base-setup index 58b0ec557..c67965e42 100755 --- a/packages/sysutils/systemd/scripts/network-base-setup +++ b/packages/sysutils/systemd/scripts/network-base-setup @@ -1,9 +1,12 @@ #!/bin/sh -# setup hostname -if [ -f /storage/.cache/hostname ]; then - cat /storage/.cache/hostname > /proc/sys/kernel/hostname -fi +. /etc/profile + +# Set hostname +HOSTNAME=$(get_setting system.hostname) +echo ${HOSTNAME} >/proc/sys/kernel/hostname +hostnamectl --transient hostname ${HOSTNAME} +avahi-set-host-name ${HOSTNAME} # setup /etc/hosts rm -f /run/libreelec/hosts