No, the hub begins shutting down immediately, so even if there were, there would be no time to do anything. This has come up at least once before.
But you're in control of when the hub shuts down or restarts. It sounds like you're doing this from an endpoint. Maybe hit another endpoint that triggers a rule (you can set up local endpoints as triggers, among other options) and does whatever you want first, perhaps also including the shutdown itself?