#!/bin/sh
# Launcher: runs Port Security as root with the current user's display.
DIR="$(dirname "$(readlink -f "$0")")"
EXE="$DIR/portsecurity.exe"; [ -f "$EXE" ] || EXE=/opt/portsecurity/portsecurity.exe
if [ "$(id -u)" -ne 0 ]; then
  exec sudo -E env DISPLAY="$DISPLAY" XAUTHORITY="${XAUTHORITY:-$HOME/.Xauthority}" mono "$EXE" "$@"
fi
exec mono "$EXE" "$@"
