This utility is designed to be used remotely to trigger the shutdown of a Mac computer, with BOOMING audio messages to the operator as the shutdown time gets closer.
e.g.
timedcomputershutdown 20m
will result in the following announcements:
Computer will turn off in 20 minutes
15 minute warning
10 minute warning
5 minute warning
1 minute warning
50 seconds
40 seconds
30 seconds
25 seconds
20 seconds
15 seconds
10
9
8
7
6
5
4
3
2
1
0
Shutting down
SIGTERM and friends will cancel the shutdown sequence.
To get my son to the dinner table. He will hate this.
Concourse job running on a Kubernetes in the Cloud, that uses Tailscale to be able to SSH to my Mac.
See the pipeline
directory in this repo for a ytt
template that will generate a nice pipeline.
I can use Tailscale on my phone to access the Concourse UI and easily trigger the job while I'm in the kitchen preparing dinner.
# install
go install github.com/continusec/timedcomputershutdown/bin/{timedcomputershutdown,shutdownnow}
# Make the second binary (shutdownnow) owned by root, and setuid - that way the whole thing doesn't need to be root
# and we can still "killall timecomputer shutdown" as non-root.
sudo chown root $HOME/go/bin/shutdownnow
sudo chmod +s $HOME/go/bin/shutdownnow
Find the job for computer and duration you want:
Kick off a new "build":
Cancelling concourse build will stop the shutdown:
Hard to tell if it succeeds or not, sometimes it shuts down too fast:
Thank you TailScale for having an awesomely fun product to allow fun projects like this, and for accepting my PRs on a weekend. :)