]> git.nbdom.net Git - nb.git/commitdiff
/home/nico/.procmailrc-pop
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 9 Apr 2018 13:34:41 +0000 (14:34 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 9 Apr 2018 13:34:41 +0000 (14:34 +0100)
etc/profile.d/functions
etc/profile.d/sys.sh

index 46fbff739bd96e41a9ad99569d1d7f30f09eeace..0c17f05cec07820d554e611fbb1bac3355764017 100644 (file)
@@ -854,7 +854,7 @@ which_cache() {
 }
 
 uncomment() {
-       grep -Ev '^\s*(["/\#\;-]|$)' $@ | grep -Ev "^\s*'" | cat
+       grep -hEv '^\s*(["/\#\;-]|$)' $@ | grep -Ev "^\s*'" | cat
 }
 
 gid_from_to() {
index 9cf379ff15aba202a063bea23005f5a005176ea4..881d2b4817ec3d96b0b39bf69315b59f3398afd9 100644 (file)
@@ -5,15 +5,27 @@
 
 sys_infos() {
        local s="$(printf '\t')"
-       cat <<EOF | grep -vE "^[^${s}]+${s}$"
-arch${s}$( (arch || sysctl -n hw.machine) 2>/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]}