Backport github changes to the devel
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/bash
|
||||
# info: change hostname
|
||||
# options: HOSTNAME
|
||||
#
|
||||
@@ -37,18 +37,20 @@ check_hestia_demo_mode
|
||||
|
||||
hostname "$domain"
|
||||
|
||||
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
|
||||
if command -v hostnamectl >/dev/null 2>&1; then
|
||||
hostnamectl set-hostname "$domain"
|
||||
echo "$domain" > /etc/hostname
|
||||
else
|
||||
# Debian/Ubuntu
|
||||
hostnamectl set-hostname "$domain"
|
||||
echo "$domain" > /etc/hostname
|
||||
if [ -d "/etc/sysconfig" ]; then
|
||||
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
|
||||
else
|
||||
echo "$domain" > /etc/hostname
|
||||
fi
|
||||
fi
|
||||
|
||||
# Update Roundcube password plugin configuration
|
||||
|
||||
Reference in New Issue
Block a user