|
@@ -34,9 +34,8 @@ config='/etc/ssh/sshd_config'
|
|
|
sftp_n=$(grep -n "Subsystem.*sftp" $config | grep -v internal | grep ":#")
|
|
sftp_n=$(grep -n "Subsystem.*sftp" $config | grep -v internal | grep ":#")
|
|
|
sftp_i=$(grep -n "^# Hestia SFTP Chroot" $config)
|
|
sftp_i=$(grep -n "^# Hestia SFTP Chroot" $config)
|
|
|
|
|
|
|
|
-date=$("date +%s")
|
|
|
|
|
# Backing up config
|
|
# Backing up config
|
|
|
-cp $config $config.bak-$(date +%s)
|
|
|
|
|
|
|
+cp $config $config.bak
|
|
|
|
|
|
|
|
# Enabling normal sftp
|
|
# Enabling normal sftp
|
|
|
if [ -n "$sftp_n" ]; then
|
|
if [ -n "$sftp_n" ]; then
|
|
@@ -61,9 +60,8 @@ if [ "$restart" = 'yes' ]; then
|
|
|
if [ "$?" -ne 0 ]; then
|
|
if [ "$?" -ne 0 ]; then
|
|
|
mail_text="OpenSSH can not be restarted. Please check config:
|
|
mail_text="OpenSSH can not be restarted. Please check config:
|
|
|
\n\n$(/usr/sbin/sshd -t)"
|
|
\n\n$(/usr/sbin/sshd -t)"
|
|
|
- echo -e "$mail_text" | $SENDMAIL -s "$subj" "$email"
|
|
|
|
|
|
|
+ echo -e "$mail_text" | $SENDMAIL -s "$subj" $email
|
|
|
else
|
|
else
|
|
|
- service ssh restart > /dev/null 2>&1
|
|
|
|
|
service sshd restart > /dev/null 2>&1
|
|
service sshd restart > /dev/null 2>&1
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
@@ -77,10 +75,6 @@ fi
|
|
|
# Hestia #
|
|
# Hestia #
|
|
|
#----------------------------------------------------------#
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
|
|
-# Restart ssh service
|
|
|
|
|
-service ssh restart > /dev/null 2>&1
|
|
|
|
|
-service sshd restart > /dev/null 2>&1
|
|
|
|
|
-
|
|
|
|
|
# Logging
|
|
# Logging
|
|
|
$BIN/v-log-action "system" "Warning" "Plugins" "SFTP Chroot Jail disabled."
|
|
$BIN/v-log-action "system" "Warning" "Plugins" "SFTP Chroot Jail disabled."
|
|
|
log_event "$OK" "$ARGUMENTS"
|
|
log_event "$OK" "$ARGUMENTS"
|