Skip to content

Instantly share code, notes, and snippets.

View asheborocreative's full-sized avatar

Dave asheborocreative

View GitHub Profile
@asheborocreative
asheborocreative / hostnamecheck.sh
Last active December 25, 2017 00:49
Check and fix hostname if it doesn't match what it should.
#!/bin/bash
CORRECT_HOSTNAME="hostname.mydomain.com"
CURRENT_HOSTNAME="$( hostname )"
if [[ $CORRECT_HOSTNAME != $CURRENT_HOSTNAME ]]; then
hostname $CORRECT_HOSTNAME
fi