#!/bin/sh
################################################################################
#                                                                              #
# Polish Kathi Team 2009                                                       #
#                                                                              #
# contact: http://pkt.cal.pl /                                                 #
#                                                                              #
################################################################################

. /var/config/emu.conf
. /var/config/newcs.conf
. /var/config/time.conf
. /var/config/swap.conf
. /var/config/language.conf

#-------------------------------------------------------------------------------
#language section
#-------------------------------------------------------------------------------

if [ $lang == pl ]; then

  info1="Czas pracy bez restartu:"
  info2="Wykorzystanie miejsca na partycji systemowej:"
  info3="Rozmiar:"
  info4="Uzyte:"
  info5="Dostepne:"
  info6="Wykorzystanie pamieci: "
  info7="Razem:"
  info8="Wolne:"
  info9="Ustawienia sieciowe:"
  info10="Adres IP:"
  info11="Maska:"
  info12="Brama:"
  info13="Zegarek:"

elif [ $lang == en ]; then

  info1="Uptime:"
  info2="System partition usage:"
  info3="Size:"
  info4="Used:" 
  info5="Available:" 
  info6="Memory usage: "
  info7="Total:" 
  info8="Free:"
  info9="Net settings:"
  info10="IP address:"
  info11="Mask:"
  info12="Gate:"
  info13="Time:"

elif [ $lang == ar ]; then

  info1="الجهوزية:"
  info2="استخدام قسم النظام:"
  info3="الحجم:"
  info4="المستخدم:" 
  info5="المتوفر:" 
  info6="استخدام الذاكرة: "
  info7="المجموع:" 
  info8="الحرة:"
  info9="إعدادات الشبكة:"
  info10="عنوان الآيبي:"
  info11="القناع:"
  info12="البوابة:"
  info13="الوقت:"
  
elif [ $lang == fr ]; then

  info1="Uptime:"
  info2="Partition systeme d'utilisation:"
  info3="grandeur:"
  info4="Utilise:" 
  info5="Disponible:" 
  info6="Utilisation de la memoire: "
  info7="Total:" 
  info8="libre:"
  info9="Parametres reseau:"
  info10="adresse IP :"
  info11="Mask:"
  info12="Gate:"
  info13="Temps:"  
  
 elif [ $lang == de ]; then

  info1="Arbeitszeit ohne Neustart:"
  info2="Benutzten Speicher auf der Systempartition:"
  info3="Grosse:"
  info4="Benutzt:"
  info5="Zu Verfugung:"
  info6="Banutzten Speicher: "
  info7="Zusammen:"
  info8="Frei:"
  info9="Netzeinstellungen:"
  info10="IP-Adresse:"
  info11="Netzmaske:"
  info12="DNS-Adresse:"
  info13="Zeit:"

elif [ $lang == it ]; then

  info1="Uptime:"
  info2="System partition usage:"
  info3="Size:"
  info4="Used:" 
  info5="Available:" 
  info6="Memory usage: "
  info7="Total:" 
  info8="Free:"
  info9="Net settings:"
  info10="IP address:"
  info11="Mask:"
  info12="Gate:"
  info13="Time:"

fi

#-------------------------------------------------------------------------------
#script section
#-------------------------------------------------------------------------------

upt=`uptime | awk '{print $3 " " $4}'`
echo "$info1 $upt"
proc=`df -h / | grep rootfs | awk '{print $5}'`
echo "$info2 $proc"
size=`df -h / | grep rootfs | awk '{print $2}'`
used=`df -h / | grep rootfs | awk '{print $3}'`
available=`df -h / | grep rootfs | awk '{print $4}'`
echo "$info3 $size  $info4 $used  $info5 $available"
echo $info6
free1=`free | grep Mem | awk '{print $2 "  " $3 "  " $4}'`
free2=`free | grep Swap | awk '{print $2 "  " $3 "  " $4}'`
free3=`free | grep Total | awk '{print $2 "  " $3 "  " $4}'`
echo "     $info7  $info4  $info8"
echo "Mem: $free1"
echo "Swap: $free2"
echo "Total: $free3"                                      
echo $info9
mac=`ifconfig eth0 | grep HWaddr | awk '{print $5}'`
echo "Mac: $mac"

adres=`ifconfig eth0 | grep addr: | awk '{gsub(/:/," "); print $3}'`
echo "$info10 $adres"

maska=`ifconfig eth0 | grep addr: | awk '{gsub(/:/," "); print $7}'`
echo "$info11 $maska"

brama=`route| grep default | awk '{gsub(/:/," "); print $2}'`
echo "$info12 $brama"

dns=`cat /etc/resolv.conf | grep nameserver | awk '{gsub(/:/," "); print "DNS: "$2}'`
echo "$dns"

echo "Emu: $emu"
echo "Newcs: $newcs"
echo "$info13 $czas"
echo "SWAP: $swap"
echo ""
 
exit 0
