]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/sys.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 17 Feb 2019 21:02:26 +0000 (21:02 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 17 Feb 2019 21:02:26 +0000 (21:02 +0000)
etc/profile.d/sys.sh

index 9e075ecc867171ccefeaac046087dd3fd67bb259..0de557b1ac22dae131f7d507cf85bf1ff474207a 100644 (file)
@@ -12,10 +12,14 @@ date_install${s}$(sys_date_install)
 ips${s}$(echo -n $(ips 2>/dev/null))
 public_ip${s}$( (http_get http://nicolas.boisselier.free.fr/myip/) 2>/dev/null)
 model${s}$([ -r /proc/device-tree/model ] && printf '%s\t%s\n' model "$(cat /proc/device-tree/model)")
-debian version${s}$([ -r /etc/debian_version ] && cat /etc/debian_version)
+os${s}$(sys_os)
 EOF
 }
 
+sys_os() {
+       [ -r /etc/debian_version ] && echo Debian $(cat /etc/debian_version) && return
+}
+
 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
 }