From a2055ed5bee40177fd017ef65e053820afba6ac8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 16 Dec 2016 20:58:56 -0500 Subject: [PATCH] shell/ssh/install: on macos, load service on script exit --- shell/ssh/install | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shell/ssh/install b/shell/ssh/install index c00febe2..da10d2ef 100755 --- a/shell/ssh/install +++ b/shell/ssh/install @@ -6,8 +6,12 @@ fi case $OSTYPE in darwin*) - # Comes preinstalled on MacOS - sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist + macos-load-ssh() { + # Comes preinstalled on MacOS + sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist + } + # Activate service when script is finished + trap macos-load-ssh EXIT ;; linux*) if [[ -f /etc/arch-release ]]; then