From: Nicolas Boisselier Date: Tue, 2 Jan 2018 20:37:04 +0000 (+0000) Subject: etc/profile.d/nb.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=123f10783b5e2d81a2be86dc77cda7efc90bd57f;p=nb.git etc/profile.d/nb.sh --- diff --git a/etc/profile.d/nb.sh b/etc/profile.d/nb.sh index 995700e3..4f310898 100644 --- a/etc/profile.d/nb.sh +++ b/etc/profile.d/nb.sh @@ -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