nixos-rebuild: Avoid subshell reading hostname

Co-Authored-By: Jörg Thalheim <Mic92@users.noreply.github.com>
This commit is contained in:
Eelco Dolstra 2020-02-01 12:11:22 +01:00
parent 7ff2e743e8
commit 2a0cf385d2

View file

@ -256,7 +256,7 @@ if [[ -n $flake ]]; then
flakeAttr="${BASH_REMATCH[2]}"
fi
if [[ -z $flakeAttr ]]; then
hostname=$(cat /proc/sys/kernel/hostname)
read -r hostname < /proc/sys/kernel/hostname
if [[ -z $hostname ]]; then
hostname=default
fi