motd make gameservers inclusion more conditional
This commit is contained in:
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user