Forum
shutdown script? - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: shutdown script? (/thread-3424.html)



shutdown script? - Skywatch - 4th Mar, 2016 08:06 PM

I would like the pi to play a mp3 on shutdown. Where would I put the command for this to happen?
I can do a start up one in rc.local, but what is the equivalent for shutting down in xbian please?

S.


RE: shutdown script? - Nachteule - 4th Mar, 2016 09:49 PM

I do not know if there is a already a standard procedure for shutdown (IMO not).

But, one way could be writing an upstart script which will be started on shutdown, reboot or both

cat /etc/init/down.conf
Code:
# Does anything at shutdown

# Only on shutdown
start on runlevel [0]
# Shutdown and reboot
#start on runlevel [06]

script
    # Do what you want here
    echo "Shutdown" >> var/log/shutdown.log
end script



RE: shutdown script? - Skywatch - 5th Mar, 2016 12:14 AM

Thanks for that, I will give that a try soon and see what happens....

S>

Having thought about it, couldn't I just use crontab to do this?
I live, I learn (but not always as fast as I need to!).