mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-05-11 00:04:36 +02:00
21 lines
351 B
Bash
21 lines
351 B
Bash
#!/sbin/openrc-run
|
|
|
|
# Copyright (c) Natanael Copa
|
|
# This code is licensed under BSD-2-Clause
|
|
|
|
description="Sets the hostname of the machine."
|
|
|
|
depend() {
|
|
keyword -prefix -lxc -docker
|
|
}
|
|
|
|
start() {
|
|
if [ -s /etc/hostname ] ; then
|
|
opts="-F /etc/hostname"
|
|
else
|
|
opts="${hostname:-localhost}"
|
|
fi
|
|
ebegin "Setting hostname"
|
|
hostname $opts
|
|
eend $?
|
|
}
|