motd make gameservers inclusion more conditional

This commit is contained in:
2026-06-14 13:48:44 -05:00
parent a97b7fb2c3
commit 6b0744330b
+13 -12
View File
@@ -93,19 +93,20 @@ in {
motd_list)} motd_list)}
echo echo
${lib.optionalString (motd_gs_list != []) ''
# --- gameservers ---
echo -e "''${headings}gameservers:''${reset}"
${lib.concatStringsSep "\n" (map (service: ''
status=$(systemctl is-active ${service} 2>/dev/null)
# --- gameservers --- if [ "$status" = "active" ]; then
echo -e "''${headings}gameservers:''${reset}" printf "%-32s%s\n" " ''${active}[${service}]''${reset}" "running"
${lib.concatStringsSep "\n" (map (service: '' else
status=$(systemctl is-active ${service} 2>/dev/null) printf "%-32s%s\n" " ''${active}[${service}]''${reset}" "not running"
fi
if [ "$status" = "active" ]; then '')
printf "%-32s%s\n" " ''${active}[${service}]''${reset}" "running" motd_gs_list)}
else ''}
printf "%-32s%s\n" " ''${active}[${service}]''${reset}" "not running"
fi
'')
motd_gs_list)}
''; '';
environment.etc."motd".mode = "0755"; environment.etc."motd".mode = "0755";