Re: How to execute a scrift after resume from suspend
Hi,
On Wed, 15 Jun 2016 11:37:43 +0200
Hans <hans.ullrich@loop.de> wrote:
> Hi folks,
>
> is there a debian way, to execute a script after resume from suspend?
>
> I need to execute the command
>
> /etc/init.d/fancontrol restart
>
> after the system is awaken again. As I am using plasma5, there is an
> option, to execute my own script. However, it is necessary, to run this
> command as root.
>
> At the moment I do this manually, which is a little bit annoying, so it
> would be nice, if there is an automatic solution.
in case you are using systemd, it seems like the "official" way is to
put a script into /lib/systemd/system-sleep which will be executed on
any suspend or resume with either "pre" or "post" as argument (iirc). In
your case the script's contents might look like:
################################
#!/bin/sh
case "${1}" in
post)
/etc/init.d/fancontrol restart
;;
esac
exit 0
################################
Best regards
Michael
.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.
The heart is not a logical organ.
-- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4
Reply to: