#!/usr/bin/env bash # Author: Lilian BESSON # Email: Lilian.BESSON[AT]ens-cachan[DOT]fr # Web version: http://perso.crans.org/besson/bin/GenerateStatsHTML.sh # Web version (2): https://bitbucket.org/lbesson/bin/src/master/GenerateStatsHTML.sh # Date: 26-03-2013 # # A small script to create a minimalistic HTML status page for my machine, # available with zamok proxying at http://perso.crans.org/besson/stats.html (private ONLY) # or locally at http://127.0.0.1/stats.html # # NOTE: ssh.dptinfo.ens-cachan.fr version # # FIXME: zamok proxying not yet available # echo -e "${yellow}.: Lilian Besson presents :." echo -e "${cyan}GenerateStatsHTML, v0.1${reset}" dest="${HOME}/www/dl/stats.html" echo -e "${cyan}Fichier de destination: ${dest}${white}" # Header echo -e "
" >> "$dest" uname -a | sed s/"x86_64 x86_64 x86_64"/x86_64/ >> "$dest" echo -e "
" >> "$dest" w -h >> "$dest" echo -e "
" >> "$dest" echo ${MY_IP:-"Not connected"} >> "$dest" echo -e "
" >> "$dest" uptime >> "$dest" # FIXME on dptinfo22 this fails badly ## echo -e "
" >> "$dest" ## $(df -kTh >> "$dest") || echo "df -kTh fails :(" echo -e "
" >> "$dest" free >> "$dest" # # FIXME remove this ugly pstree -U ! # echo -e "
" >> "$dest" # pstree -U >> "$dest" # Footer echo -e "