]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/nb.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 2 Jan 2018 20:37:04 +0000 (20:37 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 2 Jan 2018 20:37:04 +0000 (20:37 +0000)
etc/profile.d/nb.sh

index 995700e3cad514751ecf18d2e0c92adcd6284fcb..4f310898ef4bf748631ee8ac3ad15bc174801f1c 100644 (file)
@@ -84,12 +84,6 @@ nb_api() {
        curl -su "$NB_AUTH" "https://api.nbdom.net$uri" "$@"
 }
 
-nb_api_post_host_info() {
-       local host=$(hostname)
-       [ -z "$host" ] && host=$(hostname -f)
-       nb_api_post host_info "host=$host" "$@"
-}
-
 nb_api_post() {
        local usage="Usage: nb_api_post TABLE field1=val1 field2=val2 ..."
        local table="${1:?$usage}"; shift
@@ -106,6 +100,12 @@ nb_api_post() {
        )
 }
 
+nb_api_post_host_info() {
+       local host=$(hostname)
+       [ -z "$host" ] && host=$(hostname -f)
+       nb_api_post host_info "host=$host" "$@"
+}
+
 nb_post_sys_infos() {
        # To be compatible with other sed that does not support \t
        sys_infos | tr '\t' '!' | sed -e 's/"/\\"/g' -e 's/^/key="sys./' -e 's/!/" val="/' -e 's/$/"/' | while read -r i; do