Hello!
I want to remotely shut down my Raspberry Pi over lan when i power off my computer. Authentication is not an issue. I've tried serveral entries and searched across the web but i'm out of ideas.
It works fine when i start this service manually:
Code:
root@pc:/lib/systemd/system# cat rpishutdown.service
[Unit]
Description=Shutdown Raspberry Pi
[Service]
ExecStart=/usr/bin/ssh <IP> shutdown 0
but i haven't found out what dependencies it needs to be enabled in order to be executed before the network is shut down.
Further criteria that the service would need to meet:
*) it should only be executed at shutdown and not at reboot.
*) if possible it should be executed early in the shutdown-process.
Scince the RaspberryPi is powered via the PCs usb it's power supply
could be cut off before it has completely shut down. Is there a way to
make the system idle a few seconds before halt to achieve this?
Thank you.