#!/bin/bash

#  uninstallhelper.sh
#  WhatRoute2
#
#  Created by Bryan Christianson on 13/03/16.
#  Copyright © 2016 Rodney Truck Parts Ltd. All rights reserved.


label=$1

LOG=/tmp/wrh2.log

LAUNCHCTL=/bin/launchctl

echo $(date) > $LOG
(
	echo $(date)
	$LAUNCHCTL unload /Library/LaunchDaemons/$label.plist
	$LAUNCHCTL remove /Library/LaunchDaemons/$label

	rm -f /Library/PrivilegedHelperTools/$label
	rm -f /Library/LaunchDaemons/$label.plist

	echo "Removed $label"
) > $LOG 2>&1

