#!/bin/sh -e
#
if [ $(hostname -s) == "x1" ]
then
    while true;
    do
        printf 'BAT: %s%% CPU: %s°C %s Mhz %s\n' \
            "$(/usr/sbin/apm -l)" \
            "$(/sbin/sysctl -n hw.sensors.ksmn0.temp0 | cut -d"." -f1)" \
            "$(/sbin/sysctl -n hw.cpuspeed)" \
            "$(/sbin/sysctl -n hw.sensors.acpithinkpad0.fan0)";
        sleep 1;
    done
fi

if [ $(hostname -s) == "x13" ]
then
    while true;
    do
        printf 'BAT: %s%% CPU: %s°C %s Mhz %s\n' \
            "$(/usr/sbin/apm -l)" \
            "$(/sbin/sysctl -n hw.sensors.ksmn0.temp0 | cut -d"." -f1)" \
            "$(/sbin/sysctl -n hw.cpuspeed)" \
            "$(/sbin/sysctl -n hw.sensors.acpithinkpad0.fan0)";
        sleep 1;
    done
fi

if [ $(hostname -s) == "wotan" ]
then
    while true;
    do
        printf 'BAT: %s%% CPU: %s°C\n' \
            "$(/usr/sbin/apm -l)" \
            "$(/sbin/sysctl -n hw.sensors.cpu0.temp0 | cut -d"." -f1)";
        sleep 15;
    done
fi

if [ $(hostname -s) == "sunny25" ]
then
    while true;
    do
        printf "Hello, I'm sunny!\n"
        sleep 15;
    done
fi
