Skip to content

Commit caa9059

Browse files
committed
Change config on change-hostname
1 parent a0d0f87 commit caa9059

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bin/v-change-sys-hostname

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
# Argument definition
1616
domain=$1
17-
helo="${2-yes}"
1817

1918
# Includes
2019
# shellcheck source=/usr/local/hestia/func/main.sh
@@ -27,7 +26,7 @@ source $HESTIA/conf/hestia.conf
2726
# Verifications #
2827
#----------------------------------------------------------#
2928

30-
check_args '1' "$#" 'HOSTNAME [HELO]'
29+
check_args '1' "$#" 'HOSTNAME'
3130
is_format_valid 'domain'
3231

3332
# Perform verification if read-only mode is enabled
@@ -57,10 +56,13 @@ else
5756
if [ -d /etc/roundcube/ ]; then
5857
sed -i "/password_hestia_host/c\$rcmail_config['password_hestia_host'] = '$domain';" /etc/roundcube/plugins/password/config.inc.php
5958
fi
59+
if [ -d /etc/rainloop/ ]; then
60+
sed -i "/hestia_host/c\hestia_host = \"$domain\"" /etc/rainloop/data/_data_/_default_/configs/plugin-hestia-change-password.ini
61+
fi
6062
fi
6163

6264
# Update ip helo for exim
63-
if [[ ! -z "$MAIL_SYSTEM" && "$helo" == "yes" ]]; then
65+
if [ ! -z "$MAIL_SYSTEM" ]; then
6466
pub_ip=$(curl --ipv4 -s https://ip.hestiacp.com/)
6567
$BIN/v-change-sys-ip-helo $pub_ip $domain
6668
fi
@@ -70,6 +72,7 @@ fi
7072
#----------------------------------------------------------#
7173

7274
# Logging
75+
$BIN/v-log-action "system" "Warning" "System" "System hostname changed (Host: $domain)."
7376
log_event "$OK" "$ARGUMENTS"
7477

7578
exit

0 commit comments

Comments
 (0)