Преглед изворни кода

Disable temporarily ssh server to avoid warnings

lauhub пре 8 месеци
родитељ
комит
ceed7f2df8
1 измењених фајлова са 7 додато и 0 уклоњено
  1. 7 0
      scripts/01-renew-ssh-keys

+ 7 - 0
scripts/01-renew-ssh-keys

@@ -15,8 +15,15 @@ renew_ssh_keys(){
   dpkg-reconfigure openssh-server
   status=$?
 }
+# Disables to avoid error messages
+systemctl disable ssh
+systemctl stop ssh
 
 ls /etc/ssh/ssh_host_*key* > /dev/null 2>&1 && renew_ssh_keys || status=1
+
+systemctl enable ssh
+systemctl start ssh
+
 if [ 0 -ne "$status" ]
 then
   # Exit with non zero status