Jump to content
Not connected, Your IP: 3.147.27.71

Recommended Posts

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.


Occasional moderator, sometimes BOFH. Opinions are my own, except when my wife disagrees.

Share this post


Link to post

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"

Occasional moderator, sometimes BOFH. Opinions are my own, except when my wife disagrees.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...