dont install launch agent on osx

This commit is contained in:
j 2015-11-03 00:28:09 +01:00
commit a85023d560
3 changed files with 16 additions and 15 deletions

14
ctl
View file

@ -39,6 +39,20 @@ hash -r 2>/dev/null
ulimit -S -n 2048
if [ "$1" == "start" ]; then
if [ $SYSTEM == "Darwin" ]; then
launchd_name="com.openmedialibrary.loginscript"
launchd_plist="$HOME/Library/LaunchAgents/${launchd_name}.plist"
if [ -e "$launchd_plist" ]; then
launchctl stop "$launchd_name"
launchctl unload "$launchd_plist"
rm "$launchd_plist"
fi
fi
if [ $SYSTEM == "Linux" ]; then
if [ -e "$HOME/.config/autostart/openmedialibrary.desktop" ]; then
rm "$HOME/.config/autostart/openmedialibrary.desktop"
fi
fi
cd "$BASE/$NAME"
if [ -e $PID ]; then
if ps -p `cat "$PID"` > /dev/null; then