I need to run a script when the server is going for a shutdown i.e. run level 0. But the catch here is, I need to make a curl call in the script which is not possible in run level 0 as the network will be down.
So my question is how can I achieve this ?
Basically what I am looking for is a solution to run a script when the system goes from run level 3 to run level 0.
Any help is appreciated.