done
This commit is contained in:
@@ -26,7 +26,7 @@ in {
|
||||
|
||||
active="\033[1;34m"
|
||||
inactive="\033[1;31m"
|
||||
headings="\033[0;36m"
|
||||
headings="\033[1;35m"
|
||||
bold="\e[1m"
|
||||
reset="\033[0m"
|
||||
memory=`free -m | awk 'NR==2{printf "%s/%sMB (%.2f%%)\n", $3,$2,$3*100 / $2 }'`
|
||||
@@ -45,7 +45,7 @@ in {
|
||||
mem_percent=$((100 * mem_used / mem_total))
|
||||
uptime_fmt=$(uptime -p 2>/dev/null || cat /proc/uptime | awk '{print int($1/3600)"h "int(($1%3600)/60)"m"}')
|
||||
|
||||
printf "$bold Welcome to $(hostname)!$reset\n"
|
||||
printf "$bold welcome to $(hostname)!$reset\n"
|
||||
printf "\n"
|
||||
printf "$bold * %-20s$reset %s\n" "Release" "$nixos_version"
|
||||
printf "$bold * %-20s$reset %s\n" "Kernel" "$(uname -rs)"
|
||||
@@ -54,8 +54,10 @@ in {
|
||||
printf "$bold * %-20s$reset %s\n" "Memory" "$memory"
|
||||
printf "$bold * %-20s$reset %s\n" "System uptime" "$up_days days $up_hours hours $up_mins minutes $up_secs seconds"
|
||||
|
||||
echo
|
||||
|
||||
# --- services ---
|
||||
echo -e "''${headings}homelab services''${reset}"
|
||||
echo -e "''${headings}homelab services:''${reset}"
|
||||
|
||||
${lib.concatStringsSep "\n" (map (service: ''
|
||||
if systemctl list-units --type=service --all | grep -q "${service}"; then
|
||||
@@ -74,7 +76,7 @@ in {
|
||||
echo
|
||||
|
||||
# --- gameservers ---
|
||||
echo -e "''${headings}gameservers''${reset}"
|
||||
echo -e "''${headings}gameservers:''${reset}"
|
||||
for service in velocity smp superflat bento; do
|
||||
status=$(systemctl is-active $service 2>/dev/null)
|
||||
if [ "''${status}" = "active" ]; then
|
||||
|
||||
Reference in New Issue
Block a user