Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 19 lines (12 sloc) 265 Bytes
#!/bin/sh
set -e
if [ $# -ne 1 ] ; then
echo "usage $0 <hostname>" 1>&2
exit 1
fi
HOSTNAME=$1
# Update system configuration
sed -i -e "s/^\(HOSTNAME=\).*$/\1$1/g" /etc/sysconfig/network
# Set current hostname
hostnamectl set-hostname "$HOSTNAME"
exit 0
Something went wrong with that request. Please try again.