source: src-sh/about/about @ 5053ee4

releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since 5053ee4 was 5053ee4, checked in by Kris Moore <kris@…>, 9 months ago

Update src-sh/about script to auto-create the
/usr/local/share/pcbsd/version file during installation

This file will be used to pull the specific PC-BSD version string

  • Property mode set to 100755
File size: 3.0 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   
45    VERNAME="PC-BSD"
46fi
47if [ "$SYSTYPE" = "TRUEOS" ]; then
48    display_trueos_banner
49fi
50
51
52echo "General info:"
53echo "       Host:..............`hostname`"
54echo "       User:..............`whoami`"
55echo "       Uptime:............`uptime | awk '{sub(/^.* up +/,"");sub(/, *[0-9]+ users.*/,"");print}'`"
56echo "       FreeBSD ver:.......`uname -r`"
57if [ "$SYSTYPE" = "PCBSD" ]; then
58  echo "       PC-BSD ver:........`cat /usr/local/share/pcbsd/version`"
59else
60  echo "       TrueOS ver:........`cat /usr/local/share/pcbsd/version`"
61fi
62echo "       Arch:..............`uname -m`"
63echo "       Kernel ident:......`uname -i`"
64echo "       CPU:...............`sysctl -n hw.model`"
65echo "       CPU cores:.........`sysctl -n kern.smp.cpus`"
66echo "       Memory (free/avail):${FREE_MEMORY} / ${AVAIL_MEMORY} Mb"
67if [ "$SYSTYPE" = "PCBSD" ]; then
68echo "       Desktop environment:`de-info | grep "DE name" | sed "s/DE name: //"`"
69fi
70echo ""
71echo "Network ipv4 ip: "
72ifconfig | grep "inet " |  awk '{ print $2 }'
73##echo " ==> Network ipv6 ip: "
74##ifconfig | grep "inet6" |  awk '{ print $2 }'
75
76if [ "$SYSTYPE" = "PCBSD" ]; then
77echo ""
78echo "Installed desktop environments:"
79display_pkg_version "       KDE:.........." "kde-workspace"
80display_pkg_version "       Gnome:........" "gnome2-lite"
81display_pkg_version "       LXDE:........." "lxde-meta"
82display_pkg_version "       XFCE:........." "xfce"
83display_pkg_version "       e17:.........." "enlightenment"
84display_pkg_version "       Awesome:......" "awesome"
85display_pkg_version "       FVWM:........." "fvwm2"
86fi
87echo ""
88echo "System components:"
89display_pkg_version "       PC-BSD CLI:...r" "pcbsd-utils"
90display_pkg_version "       PC-BSD UI:....r" "pcbsd-utils-qt4"
91
92echo ""
Note: See TracBrowser for help on using the repository browser.