mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
18 lines
361 B
Bash
Executable File
18 lines
361 B
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
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
|
|
|
|
service avahi-daemon restart
|