daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. SYSINFO=`head -n 1 /etc/issue`
  4. IFS=$'\n'
  5. UPTIME=`uptime`
  6. D_UP=${UPTIME:1}
  7. MYGROUPS=`groups`
  8. DATE=`date`
  9. KERNEL=`uname -a`
  10. CPWD=`pwd`
  11. ME=`whoami`
  12. CPU=`arch`
  13.  
  14. printf "<=== SYSTEM ===>\n"
  15. echo "  Distro info:    "$SYSINFO""
  16. printf "  Kernel:\t"$KERNEL"\n"
  17. printf "  Uptime:\t"$D_UP"\n"
  18. free -mot | awk '
  19. /Mem/{print "  Memory:\tTotal: " $2 "Mb\tUsed: " $3 "Mb\tFree: " $4 "Mb"}
  20. /Swap/{print "  Swap:\t\tTotal: " $2 "Mb\tUsed: " $3 "Mb\tFree: " $4 "Mb"}'
  21. printf "  Architecture:\t"$CPU"\n"
  22. cat /proc/cpuinfo | grep "model name\|processor" | awk '
  23. /processor/{printf "  Processor:\t" $3 " : " }
  24. /model\ name/{
  25. i=4
  26. while(i<=NF){
  27.        printf $i
  28.        if(i<NF){
  29.                printf " "
  30.        }
  31.        i++
  32. }
  33. printf "\n"
  34. }'
  35. printf "  Date:\t\t"$DATE"\n"
  36. printf "\n<=== USER ===>\n"
  37. printf "  User:\t\t"$ME" (uid:"$UID")\n"
  38. printf "  Groups:\t"$MYGROUPS"\n"
  39. printf "  Working dir:\t"$CPWD"\n"
  40. printf "  Home dir:\t"$HOME"\n"
  41. printf "\n<=== NETWORK ===>\n"
  42. printf "  Hostname:\t"$HOSTNAME"\n"
  43. ip -o addr | awk '/inet /{print "  IP (" $2 "):\t" $4}'
  44. /sbin/route -n | awk '/^0.0.0.0/{ printf "  Gateway:\t"$2"\n" }'
  45. cat /etc/resolv.conf | awk '/^nameserver/{ printf "  Name Server:\t" $2 "\n"}'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top