From ea681bb816cf1bb90b2b9ddb9caf4569306597bc Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 14 May 2022 22:17:09 +0200 Subject: [PATCH] Setup script for daily reboots. --- .../daily_reboot/etc/systemd/system/reboot.service | 6 ++++++ .../daily_reboot/etc/systemd/system/reboot.timer | 9 +++++++++ bullseye/setup_scripts/setup_daily_reboot.sh | 9 +++++++++ 3 files changed, 24 insertions(+) create mode 100644 bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.service create mode 100644 bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.timer create mode 100755 bullseye/setup_scripts/setup_daily_reboot.sh 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 index 0000000..6566a1a --- /dev/null +++ b/bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.service @@ -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 index 0000000..741ff05 --- /dev/null +++ b/bullseye/etc_files/daily_reboot/etc/systemd/system/reboot.timer @@ -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 index 0000000..f8ed183 --- /dev/null +++ b/bullseye/setup_scripts/setup_daily_reboot.sh @@ -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 -- 2.30.2