Amazon linux support

This commit is contained in:
Serghey Rodin 2018-02-14 17:10:14 +02:00
commit 4cc3c1d287
12 changed files with 34 additions and 31 deletions

View file

@ -31,18 +31,16 @@ is_format_valid 'domain'
hostname $domain
# RHEL/CentOS
if [ -e "/etc/redhat-release" ]; then
if [ -d "/etc/sysconfig" ]; then
# RHEL/CentOS/Amazon
touch /etc/sysconfig/network
if [ -z "$(grep HOSTNAME /etc/sysconfig/network)" ]; then
echo "HOSTNAME='$domain'" >> /etc/sysconfig/network
else
sed -i "s/HOSTNAME=.*/HOSTNAME='$domain'/" /etc/sysconfig/network
fi
fi
# Debian/Ubuntu
if [ ! -e "/etc/redhat-release" ]; then
else
# Debian/Ubuntu
echo "$domain" > /etc/hostname
fi