Skip to content

Commit 73b24db

Browse files
authored
Remove Unsupported Redhat implementation (hestiacp#4875)
RedHat, CentOS aren't supported for a while now and no contributor stepped up. For this reason we're removing the code from the repo. The code has been stored in a separate branch archived/rhel-support
1 parent 40256f1 commit 73b24db

File tree

202 files changed

+377
-14992
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+377
-14992
lines changed

bin/v-add-firewall-ipset

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ IPSET_PATH="$HESTIA/data/firewall/ipset"
4444

4545
# Ensure ipset is installed
4646
if [ -z "$IPSET_BIN" ]; then
47-
if [ -f '/etc/redhat-release' ]; then
48-
dnf install -q -y ipset > /dev/null
49-
else
50-
apt-get --quiet --yes install ipset > /dev/null
51-
fi
47+
apt-get --quiet --yes install ipset > /dev/null
5248
check_result $? "Installing IPset package"
5349

5450
IPSET_BIN="$(which ipset)"

bin/v-add-sys-quota

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ fi
3333

3434
# Checking quota package
3535
if ! type -P quota &> /dev/null; then
36-
if [ -f "/etc/redhat-release" ]; then
37-
dnf -y install quota > /dev/null 2>&1
38-
else
39-
export DEBIAN_FRONTEND=noninteractive
40-
apt-get -y install quota > /dev/null 2>&1
41-
fi
36+
export DEBIAN_FRONTEND=noninteractive
37+
apt-get -y install quota > /dev/null 2>&1
4238
check_result $? "quota package installation failed" "$E_UPDATE"
4339
fi
4440

bin/v-add-web-php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,9 @@ if ! echo "$DB_SYSTEM" | grep -w 'pgsql' > /dev/null; then
8484
fi
8585

8686
# Install php packages
87-
if [ -f '/etc/redhat-release' ]; then
88-
dnf makecache -q
89-
dnf install -q -y $mph > /dev/null 2>&1 &
90-
else
91-
apt-get -qq update
92-
apt-get -y -qq -o Dpkg::Options::="--force-confold" install $mph > /dev/null 2>&1 &
93-
fi
87+
apt-get -qq update
88+
apt-get -y -qq -o Dpkg::Options::="--force-confold" install $mph > /dev/null 2>&1 &
89+
9490
BACK_PID=$!
9591

9692
# Check if package installation is done, print a spinner
@@ -108,11 +104,7 @@ echo
108104
# Check if installation was successful
109105
if [ ! -f "$php_fpm" ]; then
110106
echo "ERROR: Installation failed, please run the following command manually for debugging:"
111-
if [ -f '/etc/redhat-release' ]; then
112-
echo "dnf install $mph"
113-
else
114-
echo "apt-get install $mph"
115-
fi
107+
echo "apt-get install $mph"
116108
fi
117109

118110
# Check if required modules for apache2 are enabled

bin/v-change-sys-hostname

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,10 @@ if [[ "$current_hostname" == "$domain" ]]; then
4343
fi
4444

4545
hostname "$domain"
46-
if [ -d "/etc/sysconfig" ]; then
47-
# RHEL/CentOS/Amazon
48-
touch /etc/sysconfig/network
49-
if [ -z "$(grep HOSTNAME /etc/sysconfig/network)" ]; then
50-
echo "HOSTNAME='$domain'" >> /etc/sysconfig/network
51-
else
52-
sed -i "s/HOSTNAME=.*/HOSTNAME='$domain'/" /etc/sysconfig/network
53-
fi
54-
else
55-
# Debian/Ubuntu
56-
hostnamectl set-hostname "$domain"
57-
echo "$domain" > /etc/hostname
58-
fi
46+
47+
# Debian/Ubuntu
48+
hostnamectl set-hostname "$domain"
49+
echo "$domain" > /etc/hostname
5950

6051
# Update webmail's password plugin configuration
6152
if [ -d /etc/roundcube/ ]; then

bin/v-delete-firewall-ipset

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ IPSET_FILE="${ip_name}.${ip_version}"
4242

4343
# Install ipset package if missing
4444
if [ -z "$IPSET_BIN" ]; then
45-
if [ -f '/etc/redhat-release' ]; then
46-
dnf install -q -y ipset > /dev/null
47-
else
48-
apt-get --quiet --yes install ipset > /dev/null
49-
fi
45+
apt-get --quiet --yes install ipset > /dev/null
5046
check_result $? "Installing IPset package"
5147

5248
IPSET_BIN="$(which ipset)"

bin/v-delete-sys-ip

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ if [ -n "$interface" ]; then
6969
fi
7070
fi
7171

72-
# Deleting startup conf on RHEL/CentOS/Fedora
73-
# Need RHEL experts to fix me
74-
if [ -e "/etc/sysconfig/network-scripts/ifcfg-$interface" ]; then
75-
rm -f /etc/sysconfig/network-scripts/ifcfg-$interface
76-
fi
77-
7872
# Deleting startup conf on Debian/Ubuntu
7973
if [ -f "/etc/netplan/60-hestia.yaml" ]; then
8074
sed -i "/$ip\//d" /etc/netplan/60-hestia.yaml

bin/v-delete-web-php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ if [[ $(echo "$version 7.2" | awk '{print ($1 < $2)}') == 1 ]]; then
7070
fi
7171

7272
# Purge php packages
73-
if [ -f '/etc/redhat-release' ]; then
74-
dnf remove -y $mph > /dev/null 2>&1 &
75-
else
76-
apt-get -y purge $mph > /dev/null 2>&1 &
77-
fi
73+
apt-get -y purge $mph > /dev/null 2>&1 &
7874
BACK_PID=$!
7975

8076
# Check if package removal is done, print a spinner
@@ -92,11 +88,7 @@ echo
9288
# Check if removal was successful
9389
if [ -f "$php_fpm" ]; then
9490
echo "ERROR: Uninstallation failed, please run the following command manually for debugging:"
95-
if [ -f '/etc/redhat-release' ]; then
96-
echo "dnf remove $mph"
97-
else
98-
echo "apt-get purge $mph"
99-
fi
91+
echo "apt-get purge $mph"
10092
exit 1
10193
fi
10294

bin/v-get-sys-timezone

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@ source_conf "$HESTIA/conf/hestia.conf"
2323
# Action #
2424
#----------------------------------------------------------#
2525

26-
# Checking timesonze on RHEL/CentOS
27-
if [ -f "/etc/sysconfig/clock" ]; then
28-
source /etc/sysconfig/clock
29-
3026
# Checking timezone on Debian/Ubuntu
31-
elif [ -f "/etc/timezone" ]; then
27+
if [ -f "/etc/timezone" ]; then
3228
ZONE=$(cat /etc/timezone)
3329

3430
# Checking symlynks

bin/v-import-directadmin

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ if [ ! -e /usr/bin/rsync ] || [ ! -e /usr/bin/file ]; then
2424
echo "rsync not installed, try install it"
2525
echo "This script need: rsync, file"
2626
echo "#######################################"
27-
if [ -e /etc/redhat-release ]; then
28-
echo "Run: yum install rync file"
29-
else
30-
echo "Run: apt-get install rsync file"
31-
fi
27+
echo "Run: apt-get install rsync file"
3228
exit 3
3329
fi
3430
# Put this to 0 if you want use bash -x to debug it

bin/v-list-sys-hestia-updates

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ check_installed_deb() {
3333
TIME=$(date -d @$pkg_date +"%T")
3434
}
3535

36-
# Check details of installed .rpm package function
37-
check_installed_rpm() {
38-
rpm_data=$(rpm -qi $1)
39-
ARCH=$(echo "$rpm_data" | grep Architecture | cut -f 2 -d ' ')
40-
VERSION=$(echo "$rpm_data" | grep Version | cut -f 2 -d ':' | xargs)
41-
DATE=$(echo "$rpm_data" | grep "Build Date" | awk '{print $5 " " $6 " " $7}')
42-
TIME=$(echo "$rpm_data" | grep "Build Date" | awk '{print $8 " " $9 " " $10}')
43-
}
44-
4536
# JSON list function
4637
json_list() {
4738
IFS=$'\n'
@@ -84,22 +75,12 @@ shell_list() {
8475
#----------------------------------------------------------#
8576

8677
# Checking official latest version
87-
if [ -f '/etc/redhat-release' ]; then
88-
hestia_v=$(dnf list hestia | grep hestia | awk '{print $2}' | cut -f 1 -d '-')
89-
nginx_v=$(dnf list hestia-nginx | grep hestia-nginx | awk '{print $2}' | cut -f 1 -d '-')
90-
php_v=$(dnf list hestia-php | grep hestia-php | awk '{print $2}' | cut -f 1 -d '-')
91-
else
92-
hestia_v=$(apt-cache policy hestia | grep Candidate | cut -d ':' -f 2 | xargs)
93-
nginx_v=$(apt-cache policy hestia-nginx | grep Candidate | cut -d ':' -f 2 | xargs)
94-
php_v=$(apt-cache policy hestia-php | grep Candidate | cut -d ':' -f 2 | xargs)
95-
fi
78+
hestia_v=$(apt-cache policy hestia | grep Candidate | cut -d ':' -f 2 | xargs)
79+
nginx_v=$(apt-cache policy hestia-nginx | grep Candidate | cut -d ':' -f 2 | xargs)
80+
php_v=$(apt-cache policy hestia-php | grep Candidate | cut -d ':' -f 2 | xargs)
9681

9782
# Checking installed hestia version
98-
if [ -f '/etc/redhat-release' ]; then
99-
check_installed_rpm hestia
100-
else
101-
check_installed_deb hestia
102-
fi
83+
check_installed_deb hestia
10384

10485
UPDATED='yes'
10586
if [ -n "$hestia_v" ] && [ "$hestia_v" \> "$VERSION" ]; then
@@ -110,11 +91,7 @@ data="NAME='hestia' VERSION='$VERSION' ARCH='$ARCH'"
11091
data="$data UPDATED='$UPDATED' DESCR='Hestia core package' TIME='$TIME' DATE='$DATE'"
11192

11293
# Checking installed hestia-php version
113-
if [ -f '/etc/redhat-release' ]; then
114-
check_installed_rpm hestia-php
115-
else
116-
check_installed_deb hestia-php
117-
fi
94+
check_installed_deb hestia-php
11895

11996
UPDATED='yes'
12097
if [ -n "$php_v" ] && [ "$php_v" \> "$VERSION" ]; then
@@ -126,11 +103,7 @@ data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='Hestia internal php interpret
126103
data="$data TIME='$TIME' DATE='$DATE'"
127104

128105
# Checking installed hestia-nginx version
129-
if [ -f '/etc/redhat-release' ]; then
130-
check_installed_rpm hestia-nginx
131-
else
132-
check_installed_deb hestia-nginx
133-
fi
106+
check_installed_deb hestia-nginx
134107

135108
UPDATED='yes'
136109
if [ -n "$nginx_v" ] && [ "$nginx_v" \> "$VERSION" ]; then

0 commit comments

Comments
 (0)