Skip to content

Commit a3d7916

Browse files
author
Kristan Kenney
authored
Minor installer fixes (hestiacp#3776)
* [Debian] Ensure v-update-sys-ip runs on boot * Minor language corrections, fix IPv4 check inconsistency between installers * Fix hostname reset issue on Proxmox VE containers * Replace Discord with Documentation link in upgrade script
1 parent ba3c7b9 commit a3d7916

File tree

3 files changed

+49
-24
lines changed

3 files changed

+49
-24
lines changed

func/upgrade.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ upgrade_complete_message() {
131131
echo "The Hestia Control Panel development team "
132132
echo
133133
echo "Web: https://www.hestiacp.com/ "
134+
echo "Docs: https://docs.hestiacp.com/ "
134135
echo "Forum: https://forum.hestiacp.com/ "
135-
echo "Discord: https://discord.gg/nXRUZch "
136136
echo "GitHub: https://github.com/hestiacp/hestiacp/ "
137137
echo
138138
echo "Help support the Hestia Control Panel project by donating via PayPal: "

install/hst-install-debian.sh

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,12 +1343,12 @@ if [ -n "$(grep ^admin: /etc/group)" ] && [ "$force" = 'yes' ]; then
13431343
fi
13441344

13451345
# Enable sftp jail
1346-
echo "[ * ] Enable SFTP jail..."
1346+
echo "[ * ] Enabling SFTP jail..."
13471347
$HESTIA/bin/v-add-sys-sftp-jail > /dev/null 2>&1
13481348
check_result $? "can't enable sftp jail"
13491349

13501350
# Adding Hestia admin account
1351-
echo "[ * ] Create admin account..."
1351+
echo "[ * ] Creating default admin account..."
13521352
$HESTIA/bin/v-add-user admin $vpass $email "system" "System Administrator"
13531353
check_result $? "can't create admin user"
13541354
$HESTIA/bin/v-change-user-shell admin nologin
@@ -1477,15 +1477,15 @@ fi
14771477
if [ "$phpfpm" = "yes" ]; then
14781478
if [ "$multiphp" = 'yes' ]; then
14791479
for v in "${multiphp_v[@]}"; do
1480-
echo "[ * ] Install PHP $v..."
1480+
echo "[ * ] Installing PHP $v..."
14811481
$HESTIA/bin/v-add-web-php "$v" > /dev/null 2>&1
14821482
done
14831483
else
1484-
echo "[ * ] Install PHP $fpm_v..."
1484+
echo "[ * ] Installing PHP $fpm_v..."
14851485
$HESTIA/bin/v-add-web-php "$fpm_v" > /dev/null 2>&1
14861486
fi
14871487

1488-
echo "[ * ] Configuring PHP $fpm_v..."
1488+
echo "[ * ] Configuring PHP-FPM $fpm_v..."
14891489
# Create www.conf for webmail and php(*)admin
14901490
cp -f $HESTIA_INSTALL_DIR/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/www.conf
14911491
update-rc.d php$fpm_v-fpm defaults > /dev/null 2>&1
@@ -1966,7 +1966,7 @@ fi
19661966

19671967
# Min requirements Dovecot + Exim + Mysql
19681968
if ([ "$mysql" == 'yes' ] || [ "$mysql8" == 'yes' ]) && [ "$dovecot" == "yes" ]; then
1969-
echo "[ * ] Install Roundcube..."
1969+
echo "[ * ] Installing Roundcube..."
19701970
$HESTIA/bin/v-add-sys-roundcube
19711971
write_config_value "WEBMAIL_ALIAS" "webmail"
19721972
else
@@ -1984,7 +1984,7 @@ if [ "$sieve" = 'yes' ]; then
19841984
RC_INSTALL_DIR="/var/lib/roundcube"
19851985
RC_CONFIG_DIR="/etc/roundcube"
19861986

1987-
echo "[ * ] Install Sieve..."
1987+
echo "[ * ] Installing Sieve Mail Filter..."
19881988

19891989
# dovecot.conf install
19901990
sed -i "s/namespace/service stats \{\n unix_listener stats-writer \{\n group = mail\n mode = 0660\n user = dovecot\n \}\n\}\n\nnamespace/g" /etc/dovecot/dovecot.conf
@@ -2058,7 +2058,7 @@ $HESTIA/bin/v-add-sys-filemanager quiet
20582058
echo "[ * ] Configuring PHP dependencies..."
20592059
$HESTIA/bin/v-add-sys-dependencies quiet
20602060

2061-
echo "[ * ] Install Rclone"
2061+
echo "[ * ] Installing Rclone..."
20622062
curl -s https://rclone.org/install.sh | bash > /dev/null 2>&1
20632063

20642064
#----------------------------------------------------------#
@@ -2086,6 +2086,27 @@ fi
20862086
# Get public IP
20872087
pub_ipv4="$(curl -fsLm5 --retry 2 --ipv4 https://ip.hestiacp.com/)"
20882088
if [ -n "$pub_ipv4" ] && [ "$pub_ipv4" != "$ip" ]; then
2089+
if [ -e /etc/rc.local ]; then
2090+
sed -i '/exit 0/d' /etc/rc.local
2091+
else
2092+
touch /etc/rc.local
2093+
fi
2094+
2095+
check_rclocal=$(cat /etc/rc.local | grep "#!")
2096+
if [ -z "$check_rclocal" ]; then
2097+
echo "#!/bin/sh" >> /etc/rc.local
2098+
fi
2099+
2100+
# Fix for Proxmox VE containers where hostname is reset to non-FQDN format on reboot
2101+
check_pve=$(uname -r | grep pve)
2102+
if [ ! -z "$check_pve" ]; then
2103+
echo 'hostname=$(hostname --fqdn)' >> /etc/rc.local
2104+
echo ""$HESTIA/bin/v-change-sys-hostname" "'"$hostname"'"" >> /etc/rc.local
2105+
fi
2106+
echo "$HESTIA/bin/v-update-sys-ip" >> /etc/rc.local
2107+
echo "exit 0" >> /etc/rc.local
2108+
chmod +x /etc/rc.local
2109+
systemctl enable rc-local > /dev/null 2>&1
20892110
$HESTIA/bin/v-change-sys-ip-nat "$ip" "$pub_ipv4" > /dev/null 2>&1
20902111
ip="$pub_ipv4"
20912112
fi
@@ -2227,9 +2248,8 @@ we hope that you enjoy using it as much as we do!
22272248
Please feel free to contact us at any time if you have any questions,
22282249
or if you encounter any bugs or problems:
22292250
2230-
Documentation: https://hestiacp.com/docs/
2251+
Documentation: https://docs.hestiacp.com/
22312252
Forum: https://forum.hestiacp.com/
2232-
Discord: https://discord.gg/nXRUZch
22332253
GitHub: https://www.github.com/hestiacp/hestiacp
22342254
22352255
Note: Automatic updates are enabled by default. If you would like to disable them,

install/hst-install-ubuntu.sh

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,12 +1359,12 @@ fi
13591359
sed -i "s/%admin ALL=(ALL) ALL/#%admin ALL=(ALL) ALL/g" /etc/sudoers
13601360

13611361
# Enable sftp jail
1362-
echo "[ * ] Enable SFTP jail..."
1362+
echo "[ * ] Enabling SFTP jail..."
13631363
$HESTIA/bin/v-add-sys-sftp-jail > /dev/null 2>&1
13641364
check_result $? "can't enable sftp jail"
13651365

13661366
# Adding Hestia admin account
1367-
echo "[ * ] Create admin account..."
1367+
echo "[ * ] Creating default admin account..."
13681368
$HESTIA/bin/v-add-user admin $vpass $email "system" "System Administrator"
13691369
check_result $? "can't create admin user"
13701370
$HESTIA/bin/v-change-user-shell admin nologin
@@ -1493,11 +1493,11 @@ fi
14931493
if [ "$phpfpm" = "yes" ]; then
14941494
if [ "$multiphp" = 'yes' ]; then
14951495
for v in "${multiphp_v[@]}"; do
1496-
echo "[ * ] Install PHP $v..."
1496+
echo "[ * ] Installing PHP $v..."
14971497
$HESTIA/bin/v-add-web-php "$v" > /dev/null 2>&1
14981498
done
14991499
else
1500-
echo "[ * ] Install PHP $fpm_v..."
1500+
echo "[ * ] Installing PHP $fpm_v..."
15011501
$HESTIA/bin/v-add-web-php "$fpm_v" > /dev/null 2>&1
15021502
fi
15031503

@@ -1784,7 +1784,7 @@ if [ "$exim" = 'yes' ]; then
17841784
exim_version=$(exim4 --version | head -1 | awk '{print $3}' | cut -f -2 -d .)
17851785
# if Exim version > 4.9.4 or greater!
17861786
if ! version_ge "4.9.4" "$exim_version"; then
1787-
# Jammyy uses Exim 4.95 instead but config works with Exim4.94
1787+
# Ubuntu 22.04 (Jammy) uses Exim 4.95 instead but config works with Exim4.94
17881788
cp -f $HESTIA_INSTALL_DIR/exim/exim4.conf.4.95.template /etc/exim4/exim4.conf.template
17891789
else
17901790
cp -f $HESTIA_INSTALL_DIR/exim/exim4.conf.template /etc/exim4/
@@ -1859,7 +1859,7 @@ if [ "$clamd" = 'yes' ]; then
18591859
cp -f $HESTIA_INSTALL_DIR/clamav/clamd.conf /etc/clamav/
18601860
update-rc.d clamav-daemon defaults
18611861
echo -ne "[ * ] Installing ClamAV anti-virus definitions... "
1862-
/usr/bin/freshclam >> $LOG &
1862+
/usr/bin/freshclam >> $LOG > /dev/null 2>&1
18631863
BACK_PID=$!
18641864
spin_i=1
18651865
while kill -0 $BACK_PID > /dev/null 2>&1; do
@@ -1941,7 +1941,7 @@ fi
19411941

19421942
# Min requirements Dovecot + Exim + Mysql
19431943
if ([ "$mysql" == 'yes' ] || [ "$mysql8" == 'yes' ]) && [ "$dovecot" == "yes" ]; then
1944-
echo "[ * ] Install Roundcube..."
1944+
echo "[ * ] Installing Roundcube..."
19451945
$HESTIA/bin/v-add-sys-roundcube
19461946
write_config_value "WEBMAIL_ALIAS" "webmail"
19471947
else
@@ -1959,7 +1959,7 @@ if [ "$sieve" = 'yes' ]; then
19591959
RC_INSTALL_DIR="/var/lib/roundcube"
19601960
RC_CONFIG_DIR="/etc/roundcube"
19611961

1962-
echo "[ * ] Install Sieve..."
1962+
echo "[ * ] Installing Sieve Mail Filter..."
19631963

19641964
# dovecot.conf install
19651965
sed -i "s/namespace/service stats \{\n unix_listener stats-writer \{\n group = mail\n mode = 0660\n user = dovecot\n \}\n\}\n\nnamespace/g" /etc/dovecot/dovecot.conf
@@ -2033,7 +2033,7 @@ $HESTIA/bin/v-add-sys-filemanager quiet
20332033
echo "[ * ] Configuring PHP dependencies..."
20342034
$HESTIA/bin/v-add-sys-dependencies quiet
20352035

2036-
echo "[ * ] Install Rclone"
2036+
echo "[ * ] Installing Rclone..."
20372037
curl -s https://rclone.org/install.sh | bash > /dev/null 2>&1
20382038

20392039
#----------------------------------------------------------#
@@ -2047,9 +2047,9 @@ $HESTIA/bin/v-update-sys-ip > /dev/null 2>&1
20472047
# Get primary IP
20482048
default_nic="$(ip -d -j route show | jq -r '.[] | if .dst == "default" then .dev else empty end')"
20492049
# IPv4
2050-
primary_ipv4="$(ip -4 -d -j addr show "$default_nic" | jq -r '.[].addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
2050+
primary_ipv4="$(ip -4 -d -j addr show "$default_nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
20512051
# IPv6
2052-
#primary_ipv6="$(ip -6 -d -j addr show "$default_nic" | jq -r '.[].addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
2052+
#primary_ipv6="$(ip -6 -d -j addr show "$default_nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
20532053
ip="$primary_ipv4"
20542054
local_ip="$primary_ipv4"
20552055

@@ -2072,6 +2072,12 @@ if [ -n "$pub_ipv4" ] && [ "$pub_ipv4" != "$ip" ]; then
20722072
echo "#!/bin/sh" >> /etc/rc.local
20732073
fi
20742074

2075+
# Fix for Proxmox VE containers where hostname is reset to non-FQDN format on reboot
2076+
check_pve=$(uname -r | grep pve)
2077+
if [ ! -z "$check_pve" ]; then
2078+
echo 'hostname=$(hostname --fqdn)' >> /etc/rc.local
2079+
echo ""$HESTIA/bin/v-change-sys-hostname" "'"$hostname"'"" >> /etc/rc.local
2080+
fi
20752081
echo "$HESTIA/bin/v-update-sys-ip" >> /etc/rc.local
20762082
echo "exit 0" >> /etc/rc.local
20772083
chmod +x /etc/rc.local
@@ -2216,9 +2222,8 @@ we hope that you enjoy using it as much as we do!
22162222
Please feel free to contact us at any time if you have any questions,
22172223
or if you encounter any bugs or problems:
22182224
2219-
Documentation: https://hestiacp.com/docs/
2225+
Documentation: https://docs.hestiacp.com/
22202226
Forum: https://forum.hestiacp.com/
2221-
Discord: https://discord.gg/nXRUZch
22222227
GitHub: https://www.github.com/hestiacp/hestiacp
22232228
22242229
Note: Automatic updates are enabled by default. If you would like to disable them,

0 commit comments

Comments
 (0)