Execute a command before shutdown

view story

http://unix.stackexchange.com – I want to execute a simple command just before the computer shuts down (timing is not essential). For startup I can use /etc/rc.local - is there something similar for shutdown? Note that I would still like to use the integrated shutdown button from menu; i.e. I don't want to use a custom script everytime I shutdown via terminal - it needs to be automatical. (HowTos)