#!/bin/sh # SPDX-License-Identifier: MPL-2.0 # Read-only snapshot. No daemon, no network listener, no persistent files. set -eu test -r /proc/stat || { echo 'Only Linux /proc is supported' >&2; exit 2; } printf '__CPU__\n' head -n 1 /proc/stat printf '__MEM__\n' awk '/^(MemTotal|MemAvailable):/ {print $1,$2}' /proc/meminfo printf '__DISK__\n' df -Pk / | tail -n 1 printf '__LOAD__\n' cat /proc/loadavg printf '__UPTIME__\n' cat /proc/uptime printf '__NET__\n' cat /proc/net/dev printf '__OS__\n' if test -r /etc/os-release; then sed -n 's/^PRETTY_NAME=//p' /etc/os-release | tr -d '"'; else uname -s; fi