Include the shutdown command at the end of the script.
ChrisP If someone resolves an issue for you, or was helpful, please click the link on the bottom left hand corner of their post to give them a "star" letting them know they helped you.
It´s a good idea. I´ve already done something like that, but what I was looking for is e.g. a file that is read after the shutdown is called, so that an entry in that file could call my script.
look in /etc/rc6 and rc0 and you'll see shutdown scripts. 0 is poweroff and 6 is reboot.
if you're not sure how this works then ls -l all the rc directories and you'll see how it's done.
MrTom's suggestion will also work. The /etc/rc.d/rc6.d directory is full of scripts that are run when rebooting, and the /etc/rc.d/rc0.d directory is for shutting down. Either copy your script in one (or both) of those directories or create a symbolic link.
ChrisP If someone resolves an issue for you, or was helpful, please click the link on the bottom left hand corner of their post to give them a "star" letting them know they helped you.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.