Commit 1dafcdf8 authored by Lennart Klebl's avatar Lennart Klebl

Small bash script for some fun with the lipnsa-data

parent f8703e36
#!/bin/bash
# TODO Copy files automatically from inserted USB key.
Efifile=$(mktemp)
Memfile=$(mktemp)
Drivefile=$(mktemp)
for i in */; do
var=$(ls $i | head -1)
cat $i/$var/meminfo | grep MemTotal | awk '{print $2/1024/1024}' >> $Memfile
cat $i/$var/lsblk | grep disk | awk '{print $4}' | grep -v '^[0-9]\.[0-9]G' | grep -v "[0-9]*M" >> $Drivefile
cat $i/$var/efi >> $Efifile
done
echo -------- EFI ---------
echo $(cat $Efifile | grep yes | wc -l) ja, $(cat $Efifile | grep no | wc -l) nein.
echo -------- RAM ---------
cat $Memfile | sort -n | gnuplot -e "set terminal dumb; plot '<cat' with lines"
echo -------- HDD ---------
cat $Drivefile | sort -n | gnuplot -e "set terminal dumb; plot '<cat' with lines"
rm $Memfile $Drivefile $Efifile
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment