diff --git a/install_backuppc_linux_mac.sh b/install_backuppc_linux_mac.sh index 545fd24..33f663c 100755 --- a/install_backuppc_linux_mac.sh +++ b/install_backuppc_linux_mac.sh @@ -44,7 +44,13 @@ function ensureSshdIsRunning() sudo launchctl list | grep 'com.openssh.sshd' &> /dev/null if [ $? != 0 ]; then # enable 'Remote login' in 'system preferences' - launchctl load /System/Library/LaunchDaemons/ssh.plist &> /dev/null + sudo launchctl enable system/com.openssh.sshd &> /dev/null + + sudo launchctl load /System/Library/LaunchDaemons/ssh.plist &> /dev/null + fi + sudo launchctl list | grep 'com.openssh.sshd' &> /dev/null + if [ $? != 0 ]; then + printf '\e[1;31m%-6s\e[m' "L'activation du serveur ssh a échoué"; return "$ERROR" fi ;; 'Linux') @@ -232,6 +238,9 @@ fi #### INSTALLATION DE OPENSSH-SERVER #### ensureSshdIsRunning +if [ "$?" != "$SUCCESS" ]; then + printf '\e[1;31m%-6s\e[m' "L'installation du serveur ssh a échoué, installation annulée."; exit +fi hostkey=$(getMyHostKey) #printf "hostkey=$hostkey" if [ "$?" != "$SUCCESS" ]; then