fi
echo
+ nb_host_info repo.$name $([ "$ex" = "0" ] && echo ok || echo "err=$ex" ) 1>/dev/null 2>&1
done
ruby -r$NB_ROOT/lib/perl/NB -e "$@"
}
-nb_host_info_insert() {
+nb_host_info() {
local host=$(hostname)
[ -z "$host" ] && host=$(hostname -f)
local key="$1"
local val="$2"
- curl -sL -u nb:0TXARcQUpjHZctoROA2X.weWSZKM5DGT https://nbdom.net/host_info -d "host=$host" -d "key=$key" "val=$val"
+ curl -u nb:0TXARcQUpjHZctoROA2X.weWSZKM5DGT https://nbdom.net/host_info -H 'Accept: text/json' -d "host=$host" -d "key=$key" -d "val=$val"
}
}
# NB 07.12.17: Add LIMIT 1. If a table as not primary key when want to delete only on record
- $sql = 'DELETE FROM ' . $this->sql_name() . $where . " LIMIT 1";
+ $sql = 'DELETE FROM ' . $this->sql_name() . $where . ($this->db()->type == 'pgsql' ? '' : ' LIMIT 1');
$info['sql'] = $sql;
if (self::p('debug')) {
if ($this->perm < self::DELETE) return;
if ($this->db->type == 'sqlite' and !is_writeable($this->db->host)) return;
- $rm = $this->table->base.'/rm/'.$args;
+# NB 11.12.17 $rm = $this->table->base.'/rm/'.$args;
+ $rm = $this->table->base.'/rm/';
$r['delete'] = ''
.'<form action="'.$rm.'" method="post">'
.'<a class="button rm" href="'.$rm.'" onclick="parentNode.submit();return false;">Delete</a>'