Sorry, soon as I saw the line that disables the startup chime I knew everything here was wrong.
(a fun game whenever these silly scripts get posted is to count how many different security measures they silently disable with little to no warning to the naive)
You don't need a chime in order to try that.
A Day In The Life (time link to a few seconds before it hits at 4:21): https://youtu.be/usNsCeOV4GM?t=249