config: Drop ability to set hostname on systems without systemd

We depend on systemd for many things anyway and this code path is never tested.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-09-01 14:15:09 -07:00 committed by James Valleroy
parent 5a1f4b6647
commit 2bd0ef7c61
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -3,15 +3,6 @@
hostname="$1"
if [ -d /run/systemd/system ] ; then
hostnamectl set-hostname --transient --static "$hostname"
else
echo "$hostname" > /etc/hostname
if [ -x /etc/init.d/hostname.sh ] ; then
invoke-rc.d hostname.sh start
else
service hostname start
fi
fi
hostnamectl set-hostname --transient --static "$hostname"
service avahi-daemon restart