Skip to content

Instantly share code, notes, and snippets.

@mattimatti
Last active March 21, 2023 13:16
Show Gist options
  • Select an option

  • Save mattimatti/396eb9b68deec1d4460a3447f02c52e7 to your computer and use it in GitHub Desktop.

Select an option

Save mattimatti/396eb9b68deec1d4460a3447f02c52e7 to your computer and use it in GitHub Desktop.
#!/bin/bash
SerialNumber=$(/usr/sbin/system_profiler SPHardwareDataType | grep "Serial Number (system)" | awk '{print $4}')
log stream --style syslog -predicate 'subsystem == "com.apple.Authorization" AND eventMessage contains "authenticated as user queenofclubs"' | while read LINE; do
echo "$LINE" && curl -X POST --silent --data-urlencode \
"payload={\"text\": \"$(echo $LINE | sed "s/\"/'/g")\"}" https://hooks.slack.com/services/xxxxxx/xxxxx/xxxxx;
done
@maxxer
Copy link

maxxer commented Mar 21, 2023

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment