#!/bin/sh
#
# The example script collects information about current host
#

set -ue

LC_ALL=C
export LC_ALL

grep 'model name' /proc/cpuinfo | uniq | awk -F': ' '
     // { printf("cpu_model=%s\n", $2);}
'
echo "kernel=$(cat /proc/version)"

cat /proc/meminfo | awk '
/MemTotal/ {printf("mem_total_kB=%d\n", $2)}
'

hostname="localhost"
hostname >/dev/null 2>&1 && hostname="$(hostname)"
[ "$hostname" = "" ] && [ -f /etc/hostname ] && hostname=$(cat /etc/hostname 2>/dev/null)
echo hostname=${hostname:-"localhost"}
