From: Nicolas Boisselier Date: Mon, 9 Apr 2018 13:34:41 +0000 (+0100) Subject: /home/nico/.procmailrc-pop X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=7d3a6434cf2901c115723ca60e6671f4f2aaefa0;p=nb.git /home/nico/.procmailrc-pop --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 46fbff73..0c17f05c 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -854,7 +854,7 @@ which_cache() { } uncomment() { - grep -Ev '^\s*(["/\#\;-]|$)' $@ | grep -Ev "^\s*'" | cat + grep -hEv '^\s*(["/\#\;-]|$)' $@ | grep -Ev "^\s*'" | cat } gid_from_to() { diff --git a/etc/profile.d/sys.sh b/etc/profile.d/sys.sh index 9cf379ff..881d2b48 100644 --- a/etc/profile.d/sys.sh +++ b/etc/profile.d/sys.sh @@ -5,15 +5,27 @@ sys_infos() { local s="$(printf '\t')" - cat </dev/null ) -nproc${s}$( (nproc || sysctl -n hw.ncpu || grep ^proc /proc/cpuinfo | wc -l) 2>/dev/null ) -date_install${s}$( (date -r $(ls -1drt /lost+found /etc/ssh/ssh_host_dsa_key.pub /etc/ssh_host_dsa_key.pub|head -1) +'%F %T') 2>/dev/null ) -ippublic${s}$(curl -s http://nbdom.net/myip 2>/dev/null) + grep -vE "^[^${s}]+${s}$" << EOF +arch${s}$(sys_arch) +nproc${s}$(sys_nproc) +date_install${s}$(sys_date_install) ips${s}$(echo -n $(ips 2>/dev/null)) +ippublic${s}$( (http_get http://nbdom.net/myip || curl -s http://nbdom.net/myip) 2>/dev/null) EOF } +sys_date_install() { + (date -r $(ls -1drt /lost+found /etc/ssh/ssh_host_dsa_key.pub /etc/ssh_host_dsa_key.pub|head -1) +'%F %T') 2>/dev/null +} + +sys_nproc() { + (nproc || sysctl -n hw.ncpu || grep ^proc /proc/cpuinfo | wc -l) 2>/dev/null +} + +sys_arch() { + (arch || sysctl -n hw.machine) 2>/dev/null +} + sys_df() { df -P -l | tail -n +2 | while read -r -a i; do mount=${i[0]}