From 74ff203a1a9fc8cd6d03ae9d41d7d826ad41faf8 Mon Sep 17 00:00:00 2001 From: Jan Gerber Date: Thu, 2 Apr 2015 16:37:38 +0200 Subject: [PATCH] stop launchd agent via ./ctl stop --- ctl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ctl b/ctl index 18292b6..2bc9695 100755 --- a/ctl +++ b/ctl @@ -62,6 +62,11 @@ if [ "$1" == "debug" ]; then exec python3 oml server $@ fi if [ "$1" == "stop" ]; then + if [ $SYSTEM == "Darwin" ]; then + launchd_name="com.openmedialibrary.loginscript" + launchd_plist="$HOME/Library/LaunchAgents/${launchd_name}.plist" + test -e "$launchd_plist" && launchctl stop "$launchd_name" + fi test -e $PID && kill `cat $PID` test -e $PID && rm $PID exit $?