[Enclosure plugin] How to use a shell script



I want to use the enclosure plugin to connect a button to a GPIO. When the button is pressed, the Rasperry should be shut down. For this I would like to use a script, but I do not understand, in which folder the script must be stored.

Thanks for help.