Ensure to restart ssh service
This commit is contained in:
parent
d8e87ee1bc
commit
2342d87d7e
|
@ -63,6 +63,7 @@ function manageSshKeyForBackuppc() ## {{{
|
|||
chown -R -- "${userLogin}:" "${userHomedir}"
|
||||
}
|
||||
## }}}
|
||||
|
||||
function ensureSshdIsInstalled() ## {{{
|
||||
{
|
||||
### `command -v sshd` still return old value even after openssh-server was removed
|
||||
|
@ -81,6 +82,12 @@ function ensureSshdIsInstalled() ## {{{
|
|||
fi
|
||||
}
|
||||
## }}}
|
||||
function ensureSshdIsRunning() ## {{{
|
||||
{
|
||||
### Ensure to completely restart sshd
|
||||
service ssh --full-restart > /dev/null
|
||||
}
|
||||
## }}}
|
||||
|
||||
# }}}
|
||||
|
||||
|
@ -111,6 +118,11 @@ if [ "$?" != "${SUCCESS}" ]; then
|
|||
printf '%b' "${REDB}L'installation du serveur ssh a échoué, installation annulée.${RESET}\\n"
|
||||
exit "${ERROR}"
|
||||
fi
|
||||
ensureSshdIsRunning
|
||||
if [ "$?" != "${SUCCESS}" ]; then
|
||||
printf '%b' "${REDB}Le serveur ssh n'a pas correctement démarré, installation annulée.${RESET}\\n"
|
||||
exit "${ERROR}"
|
||||
fi
|
||||
|
||||
# }}}
|
||||
exit "${SUCCESS}"
|
||||
|
|
Loading…
Reference in New Issue