stop launchd agent via ./ctl stop

This commit is contained in:
Jan Gerber 2015-04-02 16:37:38 +02:00
parent 393fe7eb6e
commit 74ff203a1a
1 changed files with 5 additions and 0 deletions

5
ctl
View File

@ -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 $?