#!/bin/bash

# Remove the old launchd plist if needed
JENKINS_PLIST="/Library/LaunchAgents/org.jenkins-ci.plist"
if [ -f ${JENKINS_PLIST} ]; then
	rm ${JENKINS_PLIST}
fi

JENKINS_DAEMON_PLIST="/Library/LaunchDaemons/org.jenkins-ci.plist"
launchctl unload ${JENKINS_DAEMON_PLIST} || echo 'Failed to unload old Jenkins launch daemon. Maybe it is was not loaded?'
