Script updated
This commit is contained in:
Regular → Executable
+4
-10
@@ -1,4 +1,4 @@
|
||||
et -euo pipefail
|
||||
set -euo pipefail
|
||||
|
||||
USER_NAME="lobanov_v"
|
||||
REPO_URL="https://git.lobanoffhomecloud.ru/lobanov_v/easy_ssh---zabbix_agent2.git"
|
||||
@@ -56,20 +56,14 @@ cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%F-%H%M%S)
|
||||
|
||||
cp "$CLONE_DIR/sshd_config" /etc/ssh/sshd_config
|
||||
|
||||
echo "==> Проверка конфигурации SSH..."
|
||||
|
||||
echo "==> Проверка конфигурации SSH..."
|
||||
sshd -t
|
||||
|
||||
echo "==> Перезапуск службы SSH..."
|
||||
systemctl restart ssh
|
||||
|
||||
if systemctl list-unit-files | grep -q "^ssh.service"; then
|
||||
systemctl restart ssh
|
||||
elif systemctl list-unit-files | grep -q "^sshd.service"; then
|
||||
systemctl restart sshd
|
||||
else
|
||||
echo "Не удалось определить имя службы SSH."
|
||||
exit 1
|
||||
fi
|
||||
echo "Готово."
|
||||
|
||||
echo
|
||||
echo "========================================"
|
||||
|
||||
Reference in New Issue
Block a user