#!/bin/sh -ex

# uninstalls all traces of local-tld

if [ `id -u` -eq 0 ]; then
  SUDO=""
else
  SUDO=sudo
fi

$SUDO launchctl unload /Library/LaunchDaemons/ie.norma.local-tld-firewall.plist || true
launchctl unload $HOME/Library/LaunchAgents/ie.norma.local-tld-service.plist || true

$SUDO rm -f /Library/LaunchDaemons/ie.norma.local-tld-firewall.plist
rm -f $HOME/Library/LaunchAgents/ie.norma.local-tld-service.plist

$SUDO rm -f /etc/resolver/norma
