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
)
}
+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