Create server log entry inside script

user-iqIeyixQkS
New Contributor

I have a bash script which restarts, after Killing Zoom Rooms via killall.

shutdown -R now

I use this script because for whatever reason a policy using Restart Options does not work, likely because Zoom Rooms blocks it.

Unfortunately there is never a record of this script being run, either in the policies log nor any log I can find within the computer history, likely because the computer reboots before Jamf can record the execution of this script.

Is there any way to write a log of this event just before the reboot happens?

Is there a command like line 3 of the following?:

! /bin/zsh

killall ZoomPresence
jamf writeLogEntry
shutdown -r now
exit 0

Thank you!

1 REPLY 1

bentoms
Release Candidate Programs Tester

Maybe try:

/sbin/shutdown -r +1 instead of now

That would should down after a minute.. and the script will exit after the shutdown command is sent.