From 8325693818b965525e24b482a91c26b1d8d6d6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Sun, 9 Apr 2023 15:41:19 +0700 Subject: [PATCH] [util-yaml] make timers optional --- lib/util-yaml.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/util-yaml.sh b/lib/util-yaml.sh index 9341a58..66b11df 100644 --- a/lib/util-yaml.sh +++ b/lib/util-yaml.sh @@ -82,11 +82,13 @@ write_services_conf(){ echo ' mandatory: false' >> "$conf" echo '' >> "$conf" done - echo 'timers:' >> "$conf" - for s in ${enable_systemd_timers[@]}; do - echo " - name: $s" >> "$conf" - echo ' mandatory: false' >> "$conf" - echo '' >> "$conf" + if [ ! ${enable_systemd_timers[@]} -eq 0 ]; then + echo 'timers:' >> "$conf" + for s in ${enable_systemd_timers[@]}; do + echo " - name: $s" >> "$conf" + echo ' mandatory: false' >> "$conf" + echo '' >> "$conf" + fi done echo 'targets:' >> "$conf" echo ' - name: "graphical"' >> "$conf"