source: src-sh/about/about @ 05784db

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 05784db was 05784db, checked in by yurkis <yurkis@…>, 10 months ago

Fix Gnome version detection in 'about' console script

  • Property mode set to 100755
File size: 2.8 KB
Line 
1#!/bin/sh
2
3########## Memory related info ##################################
4VM_PAGESIZE=`sysctl -n vm.stats.vm.v_page_size`
5FREE_MEM=$((`sysctl -n vm.stats.vm.v_free_count` * $VM_PAGESIZE))
6INACT_MEM=$((`sysctl -n vm.stats.vm.v_inactive_count` * $VM_PAGESIZE))
7CACHE_MEM=$((`sysctl -n vm.stats.vm.v_cache_count` * $VM_PAGESIZE))
8
9AVAIL_MEMORY=$((`sysctl -n hw.realmem` /1024/1024))
10FREE_MEMORY=$((($FREE_MEM + $INACT_MEM + $CACHE_MEM) /1024 /1024))
11
12#############3 System type Pc-BSd or TrueOS #################3
13SYSTYPE="`pbreg get /PC-BSD/SysType`"
14
15display_pcbsd_banner()
16{
17  echo "     ____  ______        ____ _____ ____"
18  echo "    / __ \/ ____/       / __ ) ___// __ \ " 
19  echo "   / /_/ / /     ___   / __  \__ \/ / / / " 
20  echo "  / ____/ /___  /___/ / /_/ /__/ / /_/ / " 
21  echo " /_/    \____/       /_____/____/_____/" 
22  echo ""
23}
24
25display_trueos_banner()
26{
27echo "  ______                   ____  _____"
28echo " /_  __/______  _____     / __ \/ ___/ "
29echo "  / / / ___/ / / / _ \   / / / /\__ \ "
30echo " / / / /  / /_/ /  __/  / /_/ /___/ / "
31echo "/_/ /_/   \__,_/\___/   \____//____/  "
32echo ""                                     
33}
34display_pkg_version()
35{
36  VER=`pkg query %v $2`
37
38  if [ "$VER" != "" ] ; then
39    echo "${1}${VER}"
40  fi
41}
42
43if [ "$SYSTYPE" = "PCBSD" ]; then
44    display_pcbsd_banner   
45fi
46if [ "$SYSTYPE" = "TRUEOS" ]; then
47    display_trueos_banner
48fi
49
50
51echo "General info:"
52echo "       Host:..............`hostname`"
53echo "       User:..............`whoami`"
54echo "       Uptime:............`uptime | awk '{sub(/^.* up +/,"");sub(/, *[0-9]+ users.*/,"");print}'`"
55echo "       FreeBSD ver:.......`uname -r`"
56echo "       Arch:..............`uname -m`"
57echo "       Kernel ident:......`uname -i`"
58echo "       CPU:...............`sysctl -n hw.model`"
59echo "       CPU cores:.........`sysctl -n kern.smp.cpus`"
60echo "       Memory (free/avail):${FREE_MEMORY} / ${AVAIL_MEMORY} Mb"
61if [ "$SYSTYPE" = "PCBSD" ]; then
62echo "       Desktop environment:`de-info | grep "DE name" | sed "s/DE name: //"`"
63fi
64echo ""
65echo "Network ipv4 ip: "
66ifconfig | grep "inet " |  awk '{ print $2 }'
67##echo " ==> Network ipv6 ip: "
68##ifconfig | grep "inet6" |  awk '{ print $2 }'
69
70if [ "$SYSTYPE" = "PCBSD" ]; then
71echo ""
72echo "Installed desktop environments:"
73display_pkg_version "       KDE:.........." "kde-workspace"
74display_pkg_version "       Gnome:........" "gnome2-lite"
75display_pkg_version "       LXDE:........." "lxde-meta"
76display_pkg_version "       XFCE:........." "xfce"
77display_pkg_version "       e17:.........." "enlightenment"
78display_pkg_version "       Awesome:......" "awesome"
79display_pkg_version "       FVWM:........." "fvwm2"
80fi
81echo ""
82echo "System components:"
83display_pkg_version "       PC-BSD CLI:...r" "pcbsd-utils"
84display_pkg_version "       PC-BSD UI:....r" "pcbsd-utils-qt4"
85
86echo ""
Note: See TracBrowser for help on using the repository browser.