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