Set a generic yet descriptive hostname

The default is to inherit the hostname from the build environment.
This commit is contained in:
Olaf Meeuwissen 2017-08-19 12:03:01 +09:00
parent 489dd2ab2d
commit e4bd65c005
1 changed files with 11 additions and 0 deletions

11
scripts/set-generic-hostname Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh -eu
# set-generic-hostname -- to a descriptive, reproducible string
# Copyright (C) 2017 Olaf Meeuwissen
#
# License: GPL-3.0+
. /etc/os-release
echo $ID-$(cat /etc/${ID}_version) > /etc/hostname
chmod 0644 /etc/hostname
rm $0