pull/5/head
xSmurf 9 years ago
parent 20c02dcd96
commit 4b7c99b961

@ -25,9 +25,9 @@ do_start() {
if [ -e /usr/bin/openssl ]; then if [ -e /usr/bin/openssl ]; then
WORD=$(/usr/bin/openssl rand -hex 8) WORD=$(/usr/bin/openssl rand -hex 8)
elif [ -e /usr/bin/hexdump ]; then elif [ -e /usr/bin/hexdump ]; then
WORD=$(dd if=/dev/urandom bs=8 count1 2>>/dev/null | /usr/bin/hexdump -v -e '/1 "%02x"') WORD=$(dd if=/dev/urandom bs=8 count=1 2>>/dev/null | /usr/bin/hexdump -v -e '/1 "%02x"')
elif [ -e /usr/bin/od ]; then elif [ -e /usr/bin/od ]; then
WORD=$(dd if=/dev/urandom bs=8 count1 2>>/dev/null | /usr/bin/od -An -tx8 | tr -d ' ') WORD=$(dd if=/dev/urandom bs=8 count=1 2>>/dev/null | /usr/bin/od -An -tx8 | tr -d ' ')
else else
echo -e "\nERROR: Unable to set random hostname!\n" echo -e "\nERROR: Unable to set random hostname!\n"
exit 1 exit 1

Loading…
Cancel
Save