[util-yaml] update if routines

This commit is contained in:
Philip Mueller 2023-04-21 09:39:42 +07:00
parent 18ce522cab
commit 18b93d69db

View file

@ -76,13 +76,15 @@ write_services_conf(){
msg2 "Writing %s ..." "${conf##*/}"
echo '---' > "$conf"
echo '' >> "$conf"
echo 'services:' >> "$conf"
for s in ${enable_systemd[@]}; do
echo " - name: $s" >> "$conf"
echo ' mandatory: false' >> "$conf"
echo '' >> "$conf"
done
if [ ! ${enable_systemd_timers[@]} -eq 0 ]; then
if [ ! ${#enable_systemd[@]} -eq 0 ]; then
echo 'services:' >> "$conf"
for s in ${enable_systemd[@]}; do
echo " - name: $s" >> "$conf"
echo ' mandatory: false' >> "$conf"
echo '' >> "$conf"
done
fi
if [ ! ${#enable_systemd_timers[@]} -eq 0 ]; then
echo 'timers:' >> "$conf"
for s in ${enable_systemd_timers[@]}; do
echo " - name: $s" >> "$conf"
@ -94,12 +96,14 @@ write_services_conf(){
echo ' - name: "graphical"' >> "$conf"
echo ' mandatory: true' >> "$conf"
echo '' >> "$conf"
echo 'disable:' >> "$conf"
for s in ${disable_systemd[@]}; do
echo " - name: $s" >> "$conf"
echo ' mandatory: false' >> "$conf"
echo '' >> "$conf"
done
if [ ! ${#disable_systemd[@]} -eq 0 ]; then
echo 'disable:' >> "$conf"
for s in ${disable_systemd[@]}; do
echo " - name: $s" >> "$conf"
echo ' mandatory: false' >> "$conf"
echo '' >> "$conf"
done
fi
}
write_displaymanager_conf(){