#!/bin/bash accept=${HTTP_ACCEPT,,} language=${HTTP_ACCEPT_LANGUAGE,,} language=${language:0:2} if [ "$accept" != "${accept/application\/json/}" ] ; then echo "Content-type: application/json" echo uptime | sed -r 's/^.*load average: (.*), (.*), (.*)/{"load": {"1": \1, "5": \2, "15": \3}}/;' else if [ "$language" == "de" ] ; then if [ "$accept" != "${accept/text\/html}" ] ; then echo "Content-type: text/html" echo "Content-language: de" echo echo "
load
Die 'load' Ressource enthält das Unix-System Lastinformationen für diesen Server.
" echo "GET
ist die einzige gültige Methode.
Daten als application/json
zurück.
load
The 'load' resource contains the unix system load information for this server.
" echo "GET
is the only valid method.
Data is returned as application/json
.