zhang888 1066 Posted ... RANDOM_HOSTNAME=$(shuf -n 1 /etc/dictionaries-common/words | sed -r 's/[^a-zA-Z]//g' | awk '{print tolower($0)}') All you have to do is to place a dictionary file in /etc/dictionaries-common/words and the rest will work.You can find online many such dictionaries, one word per line. Quote Hide zhang888's signature Hide all signatures Occasional moderator, sometimes BOFH. Opinions are my own, except when my wife disagrees. Share this post Link to post
cm0s 118 Posted ... removed like a fired fbi director in the no spin zone Quote Share this post Link to post
zhang888 1066 Posted ... I just did above. change_hostname() { echo CURRENT_HOSTNAME=$(hostname) clean_dhcp RANDOM_HOSTNAME=$(shuf -n 1 /etc/dictionaries-common/words | sed -r 's/[^a-zA-Z]//g' | awk '{print tolower($0)}') NEW_HOSTNAME=${1:-$RANDOM_HOSTNAME} echo "$NEW_HOSTNAME" > /etc/hostnamesed -i 's/127.0.1.1.*/127.0.1.1\t'"$NEW_HOSTNAME"'/g' /etc/hosts echo -n " * Service "service hostname start 2>/dev/null || echo "hostname already started" Quote Hide zhang888's signature Hide all signatures Occasional moderator, sometimes BOFH. Opinions are my own, except when my wife disagrees. Share this post Link to post