macOS tools moving to my git

This commit is contained in:
2026-05-10 12:53:30 -07:00
parent 61c0d4b5f1
commit 83156ea9e8
101 changed files with 3011 additions and 0 deletions

23
shutdown_safe Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
OUTPUT='/tmp/statusmail.txt'
TIMEINT='2h'
START="$(date +%s)"
echo "" > ${OUTPUT}
log show --style syslog --last ${TIMEINT} | fgrep "Wake reason" | fgrep "Maintenance" >> ${OUTPUT2}
lines=`cat ${OUTPUT2} | grep -c '^'`
DURATION=$[ $(date +%s) - ${START} ]
echo "----| Shut Down Report |----" >> ${OUTPUT}
echo "" >> ${OUTPUT}
echo "Occurances: $lines" >> ${OUTPUT}
echo "Duration: ${DURATION}" >> ${OUTPUT}
echo "Time Interval: ${TIMEINT}" >> ${OUTPUT}
echo "------------------------------------------------------------------" >> ${OUTPUT}
echo "" >> ${OUTPUT}
echo "" >> ${OUTPUT}
echo "" >> ${OUTPUT}
echo "" >> ${OUTPUT}
echo "------------------------------------------------------------------" >> ${OUTPUT}
/usr/bin/python3 /Users/shughey/Dropbox/bin/send_status_mail3.py
rm ${OUTPUT}
osascript -e 'tell app "System Events" to shut down'