PirateBox-Dev / PirateBoxScripts_Webserver

PirateBox Scriptcollection for running in Webserver
GNU General Public License v3.0
206 stars 102 forks source link

RPi - timesave improvement. Save time during reboot #190

Closed MaStr closed 6 years ago

MaStr commented 6 years ago

If Pi is rebooted, the timesave function should store the time with a shutdown service. New service file needed which is exectued by shutdown dependency

neutralinsomniac commented 6 years ago

Should be able to do this in the systemd unit:

[Unit]
Description=PirateBox timesave service

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf recover
ExecStop=/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf save
TimeoutSec=20

[Install]
WantedBy=multi-user.target