Informations sur le Raspberry Pi après la connexion

Informations sur le Raspberry Pi après la connexion.

Ouvrir :

informations.sh

Ajouter :

#!/bin/bash
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d jours, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`
# get the load averages
read one five fifteen rest < /proc/loadavg
echo "$(tput setaf 2)
   .~~.   .~~.    `date +"%A, %e %B %Y, %R"`
  '. \ ' ' / .'   `uname -srmo`$(tput setaf 1)
   .~ .~~~..~.
  : .~.'~'.~. :    Uptime...............: ${UPTIME}
 ~ (   ) (   ) ~   Mémoire..............: $((`cat /proc/meminfo | grep MemFree | awk {'print $2'}`/1024)) mo (libre) / $((`cat /proc/meminfo | grep MemTotal | awk {'print $2'}`/1024)) mo (total)
( : '~'.~.'~' : )  Charge moyennes......: ${one}, ${five}, ${fifteen} (1, 5, 15 min)
 ~ .~ (   ) ~. ~   Processus actifs.....: `ps ax | wc -l | tr -d " "`
  (  : '~' :  )    Adresses IP..........: `/sbin/ifconfig | /bin/grep "Bcast:" | /usr/bin/cut -d ":" -f 2 | /usr/bin/cut -d " " -f 1` et `wget -q -O - http://icanhazip.com/ | tail`
   '~ .~~~. ~'     Température..........: `vcgencmd measure_temp | sed "s/temp=//"`
       '~'         Espace disque libre..: `df -Pkh | grep -E '^rootfs' | awk '{ print $4 }' | awk -F '.' '{ print $1 }'` sur /
                   Espace disque libre..: `df -Pkh | grep -E '^/dev/sda1' | awk '{ print $4 }' | awk -F '.' '{ print $1 }'` sur /dev/sda1
$(tput sgr0)"

Action :

chmod 755 informations.sh

Ouvrir :

.bashrc

Ajouter à la fin :

./informations.sh

Test :

pi@framboise ~ $ source .bashrc

Résultat :
informations_console
Liens :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=91&t=23440
http://raspi-blog.tk/?type=article&id=5&nom=Une%20supervision%20personnalis%C3%A9e%20%C3%A0%20la%20connexion

Leave a Reply

You must be logged in to post a comment.