home · contact · privacy
Setup script for daily reboots.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 14 May 2022 20:17:09 +0000 (22:17 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 14 May 2022 20:17:09 +0000 (22:17 +0200)
bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.service [new file with mode: 0644]
bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.timer [new file with mode: 0644]
bullseye/setup_scripts/setup_daily_reboot.sh [new file with mode: 0755]

diff --git a/bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.service b/bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.service
new file mode 100644 (file)
index 0000000..6566a1a
--- /dev/null
@@ -0,0 +1,6 @@
+[Unit]
+Description=Scheduled Reboot
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/systemctl --force reboot
diff --git a/bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.timer b/bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.timer
new file mode 100644 (file)
index 0000000..741ff05
--- /dev/null
@@ -0,0 +1,9 @@
+[Unit]
+Description=schedule reboot
+
+[Timer]
+Unit=reboot.service
+OnCalendar=*-*-* 7:00:00
+
+[Install]
+WantedBy=timers.target
diff --git a/bullseye/setup_scripts/setup_daily_reboot.sh b/bullseye/setup_scripts/setup_daily_reboot.sh
new file mode 100755 (executable)
index 0000000..f8ed183
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+
+# Set up system without user environment.
+config_tree_prefix="${HOME}/config/bullseye"
+
+./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" daily_reboot 
+systemctl enable reboot.timer 
+systemctl start reboot.timer