From: Nicolas Boisselier Date: Tue, 19 Feb 2019 01:50:59 +0000 (+0000) Subject: etc/profile.d/sys.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=af90f44a7b29fe112c438c681a2852bdb479eda7;p=nb.git etc/profile.d/sys.sh --- diff --git a/etc/profile.d/sys.sh b/etc/profile.d/sys.sh index 9ad12aba..95d3f405 100644 --- a/etc/profile.d/sys.sh +++ b/etc/profile.d/sys.sh @@ -131,7 +131,7 @@ sys_os() { . /etc/os-release && echo $ID $VERSION ) - elif wich sw_vers > /dev/null; then + elif which sw_vers > /dev/null; then echo $(sw_vers 2>/dev/null | awk -F':\t' '/^(ProductName|ProductVersion)/{print $2}' | head -2) && return fi @@ -146,6 +146,8 @@ sys_mem_used() { sysctl -n hw.usermem 2>/dev/null || free -b | awk '/^Mem:/{print $3; exit}' } +#sys_mem_free() { echo $((`sys_mem_total` - `sys_mem_used`)); } + sys_interfaces() { ( if which ip > /dev/null; then