Backport github changes to the devel

This commit is contained in:
Alexey Berezhok
2025-05-28 22:47:05 +03:00
parent 4be77a30e1
commit 08e5b49cab
58 changed files with 129156 additions and 46481 deletions

View File

@@ -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