Correct the warning if sshd is unavailable.
This commit is contained in:
parent
a424966e22
commit
8286b26d96
|
@ -44,7 +44,7 @@ function ensurePingIsAllowed()
|
||||||
'Darwin')
|
'Darwin')
|
||||||
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode off
|
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode off
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
printf '\e[1;31m%-6s\e[m' "La désactivation du mode furtif a échoué"; return "$ERROR"
|
printf '\e[1;31m%-6s\e[m' "La désactivation du mode furtif a échoué"; return "$ERROR"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
'Linux')
|
'Linux')
|
||||||
|
@ -61,12 +61,12 @@ function ensureSshdIsRunning()
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
# enable 'Remote login' in 'system preferences'
|
# enable 'Remote login' in 'system preferences'
|
||||||
sudo launchctl enable system/com.openssh.sshd &> /dev/null
|
sudo launchctl enable system/com.openssh.sshd &> /dev/null
|
||||||
|
|
||||||
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist &> /dev/null
|
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist &> /dev/null
|
||||||
fi
|
fi
|
||||||
sudo launchctl list | grep 'com.openssh.sshd' &> /dev/null
|
sudo launchctl list | grep 'com.openssh.sshd' &> /dev/null
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
printf '\e[1;31m%-6s\e[m' "L'activation du serveur ssh a échoué"; return "$ERROR"
|
printf '\e[1;31m%-6s\e[m' "L'activation du serveur ssh a échoué"; return "$ERROR"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
'Linux')
|
'Linux')
|
||||||
|
@ -99,7 +99,7 @@ function getMyHostKey() {
|
||||||
if [ ! -f "${hostkey}" ]; then
|
if [ ! -f "${hostkey}" ]; then
|
||||||
hostkey="/etc/ssh/ssh_host_rsa_key.pub"
|
hostkey="/etc/ssh/ssh_host_rsa_key.pub"
|
||||||
if [ ! -f "${hostkey}" ]; then
|
if [ ! -f "${hostkey}" ]; then
|
||||||
printf '\e[1;31m%-6s\e[m' "Impossible de trouver la clef ssh publique ce cette machine, installation annulée."
|
printf '\e[1;31m%-6s\e[m' "Impossible de trouver la clef ssh publique ce cette machine, SSH est-il bien installé?\n Installation annulée."
|
||||||
return "$ERROR"
|
return "$ERROR"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue