8 lines
197 B
Bash
8 lines
197 B
Bash
#!/bin/sh
|
|
|
|
#
|
|
# Initialize /etc/hostid if it doesn't exist or is empty
|
|
#
|
|
if [ ! -f /etc/hostid -o "$(cat /etc/hostid 2>/dev/null)" = "" ]; then
|
|
dd if=/dev/urandom bs=4 count=1 of=/etc/hostid
|
|
fi
|