From: Christian Heller Date: Sat, 14 May 2022 20:17:09 +0000 (+0200) Subject: Setup script for daily reboots. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/static/%7B%7Bprefix%7D%7D/te%22st.html?a=commitdiff_plain;h=ea681bb816cf1bb90b2b9ddb9caf4569306597bc;p=config Setup script for daily reboots. --- 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