ports/main/s6-services/rc/core/hostname/up

4 lines
184 B
Plaintext

#!/bin/execlineb -P
if -t { test -s /etc/hostname } backtick -n -E HOSTNAME { head -1 /etc/hostname }
if -t { test -n $HOSTNAME } redirfd -w 1 /proc/sys/kernel/hostname echo $HOSTNAME