Ga naar de inhoud
Home » Commando vlak voor shutdown

Commando vlak voor shutdown

Maak een script dat uitgevoerd moet worden vlak voor shutdown, of gebruik een reeds bestaand script/commando

Plaats de volgende file in /etc/systemd/system/run-before-shutdown.service

[Unit]
Description=Run my custom task at shutdown
DefaultDependencies=no
Before=shutdown.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/telegramsend arjanpc: going down
TimeoutStartSec=0

[Install]
WantedBy=shutdown.target

Reload systemd

sudo systemctl daemon-reload

Enable haar:

systemctl enable run-before-shutdown.service

Klaar!