1#!/usr/bin/env bash 2# SPDX-License-Identifier: LGPL-2.1-or-later 3set -eux 4set -o pipefail 5 6: >/failed 7 8cat >/lib/systemd/system/my.service <<EOF 9[Service] 10Type=oneshot 11ExecStart=/bin/echo Timer runs me 12EOF 13 14cat >/lib/systemd/system/my.timer <<EOF 15[Timer] 16OnBootSec=10s 17OnUnitInactiveSec=1h 18EOF 19 20systemctl unmask my.timer 21 22systemctl start my.timer 23 24mkdir -p /etc/systemd/system/my.timer.d/ 25cat >/etc/systemd/system/my.timer.d/override.conf <<EOF 26[Timer] 27OnBootSec=10s 28OnUnitInactiveSec=1h 29EOF 30 31systemctl daemon-reload 32 33systemctl mask my.timer 34 35touch /testok 36rm /failed 37