Switch of the power supply with shutdown.sh?

  • Hi,

    I want to cut the power lines with a relay on my raspberry pi. I could switch the relay with a gpio tools script. But ask me if is safe to put the script in /storage/.config/shutdown.sh. I don't know if the devices are already proper unmounted?

    If not is there a alternative place, behind the unmount commands?

    TIA Jürgen

  • Are you trying to turn off the backlight of an lcd screen?I guess it would be easier and cleaner to just cut the power to the screen using relay/transistor then to the pi altogether,doesn't look like a neat shutdown to me or try the "Pi Supply Switch"

  • Mario77, no not only a backlight. I want to turn off the power supply of the pi. If I turn kodi off the tv will automatic power down. But some times I forget turn off the pi supply.

    I use also a relais (gpio) which turns the loudspeaker/amplifier delayed on (startup.sh) and off (shutdown.sh) to avoid the switch-on pulse. Now I want a same method to switch the power of the pi supply of after the partitions would be clean. (Otherwise I need a hardware cuircuit for delaying like a car interior light or a toilet fan.)