Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Check and fix hostname if it doesn't match what it should.
CURRENT_HOSTNAME="$( hostname )"

This comment has been minimized.

Copy link
Owner Author

commented Dec 25, 2017

Updated so it's the short version with no echoing. You can run this via a cronjob to force fix your hostname in the event that it has changed. This can happen with some VPS and Dedicated Server providers when the instance is rebooted. It's really annoying when that happens so this can be used to help fix it when it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.