#!/bin/sh

set -e
USER_ID=`id -u "$USER"`
/bin/launchctl bootstrap gui/$USER_ID /Library/LaunchAgents/com.shortstorybox.SmartcardIdentifier.plist
/bin/launchctl submit -l SmartcardIdentifierPermissions -- /usr/local/bin/smartcard-identifier --test-permissions
/bin/launchctl remove SmartcardIdentifierPermissions

