I made a service following this guide so I did: Created a systemd service unit Created a startup shell script Configured and installed the service
Now, my script is this one. Basically, at startup it did something depending if my laptop is charging or not, and then every X minutes it check it again and set CPUs frequencies etc..
Now, sometimes it happens I want to stop it to reobtain full power by my laptop, so I stop it, but I now should set again CPUs frequencies etc.
Is it possible that, when I do
systemctl stop battery-script.service it execute another script or some lines of code before stopping?
Thanks in advance