Fix hostname-spoof when openssl bin is not present...

pull/5/head
xSmurf 9 years ago
parent ca5dbd4823
commit e614ee9d73

@ -24,8 +24,13 @@ do_start() {
#WORD=$(/usr/bin/shuf -n1 "$FILE") #WORD=$(/usr/bin/shuf -n1 "$FILE")
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)
else 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 count1 2>>/dev/null | /usr/bin/hexdump -v -e '/1 "%02x"')
elif [ -e /usr/bin/od ]; then
WORD=$(dd if=/dev/urandom bs=8 count1 2>>/dev/null | /usr/bin/od -An -tx8 | tr -d ' ')
else
echo -e "\nERROR: Unable to set random hostname!\n"
exit 1
fi fi
ES=$? ES=$?
if [ $ES -gt 0 ]; then if [ $ES -gt 0 ]; then

Loading…
Cancel
Save