OpenMediaVault-Plugin-Developers / openmediavault-autoshutdown

OpenMediaVault plugin to provide frontend for autoshutdown script
37 stars 31 forks source link

How can I set a custom SHUTDOWNCOMMAND ? #133

Closed Number-313 closed 4 months ago

Number-313 commented 4 months ago

I would like to run a script instead of using the default shutdown command...

I've tried editing the autoshutdown.default file, and it didn't work.

I've tried editing autoshutdown.conf file, but it gets overwritten.

I've tried entering the path of my script in the "expert settings", but it just runs the script before even starting the checks...

Am I missing something ? I need help please.

ryecoaaron commented 4 months ago

It isn't possible. The code only allows one of the options from the plugin's Shutdown command dropdown.

Number-313 commented 4 months ago

Alright, I found a workaround : I simply changed the shutdown command.

Locate your shutdown command :

which shutdown

For me it returned :

/usr/sbin/shutdown

Now backup the file :

mv /usr/sbin/shutdown /usr/sbin/shutdown.orig

Now create a new shutdown file with the path of your script :

vi /usr/sbin/shutdown

/myscriptpath/shutdownscript.sh

If you used the shutdown command in your script, change it now to shutdown.orig Now, whenever I use shutdown, it plays my script that ends with shutdown.orig