infonow - all system information

Publicado por Jefferson Rocha (última atualização em 13/07/2018)

[ Hits: 493 ]

Homepage: https://slackjeff.com.br

Download infonow




Informações do sistema. Maiores informações em: https://notabug.org/jeffersonrocha/infonow

  



Esconder código-fonte

#!/bin/sh
#===========HEADER==================================================|
#AUTHOR
#  Jefferson Rocha <lrcjefferson@gmail.com>
#
#PROGRAM
#  infonow - All system information!
#
#SMALL DESC
#  Look all information on your OS
#
#CHANGELOG
#===================================================================|

#=====VARS==========================|
name="infonow"
version="0.2"
#===================================|

#=====TEST==========================|
[ "$UID" -ne "0" ] && {
    printf '%b\n' "Only Root!"
    exit 1
}
#===================================|

#====FUNC===========================|
_usage(){
cat << EOF
NAME
   infonow...[OPTION]

USAGE
   help, usage      Open this help option and exit.

VERSION
   ${version}

AUTHOR
   Jefferson Rocha <lrcjefferson@gmail.com>

EOF

exit 0
}

information(){
  #===> Running System
  OS_SYSTEM=$(grep "^NAME" /etc/os-release | cut -d '=' -f '2') # Find name
  OS_SYSTEM="${OS_SYSTEM//\"/}"                                 # Have " ? no more.
  #===> CPU
  CPU=$(grep "^m.*me" /proc/cpuinfo | cut -d ':' -f 2)          # Find model name
  CPU="${CPU/ /}"                                                               # space? noooo
  #===> SPACE
  HD_TOTAL=$(df -HP | grep "/$" | cut -d ' ' -f 8)                # Total space
  HD_DISP=$(df -HP | grep "/$" | cut -d ' ' -f 13)                 # Available space
  #===> UPTIME
  UPTIME=$(uptime -p)
  UPTIME="${UPTIME/up/}"                                               # cut initial up
  UPTIME="${UPTIME/ /}"                                                  # BYE BYE SPACE
  #===> MEM
  RAM=$(free -ht | grep "^[Mm]em.*" | cut -d ' ' -f '10')       # RAM?
  #===> KERNEL
  KERNEL_VERSION=$(uname -r)                                    # Need a kernel baby
  #===> GATEWAY
  GATEWAY=$(ip route | grep "^default" | cut -d ' ' -f '3' | head -n1) # Gateway
}
#===================================|

if [ "$1" = "usage" ] || [ "$1" = "help" ];then
     _usage
fi

clear
# Print STDOUT
information # Call Function
cat <<END
$name Version $version

+-+-+-+-+-+-+-+-+-+-+-+-+-System Information+-+-+-+-+-+-+-+-+-+-+-+-+-
Operational System: $OS_SYSTEM
Lang:                        $LANG
Kernel Version:         $KERNEL_VERSION
Cpu:                          $CPU
Uptime:                     $UPTIME
Total Ram::               $RAM
HD:                           $HD_DISP of $HD_TOTAL
Gateway:                  $GATEWAY
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
END

Scripts recomendados

Crivo de Eratóstenes Simples em Shell Script (BASH Script)

OpenOffice Modo Texto

Script em Xdialog para montar / desmontar dispositivos

Automatizar e compactar backup de banco MySQL

A coisa funciona?


  

Comentários
[1] Comentário enviado por albfneto em 14/07/2018 - 18:57h

vc sempre faz coisas boas. script baixado e favoritado
¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
Albfneto,
Ribeirão Preto, S.P., Brasil.
Usuário Linux, Linux Counter: #479903.
Distros Favoritas: [i] Sabayon, Gentoo, OpenSUSE, Mageia e OpenMandriva[/i].


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor HostGator.
Linux banner
Linux banner
Linux banner

Destaques

Artigos

Dicas

Viva o Android

Tópicos

Top 10 do mês

Scripts