#################################################################################
warn "$NAME: Command: ",join(" ",map{/\s+/ ? '"'.$_.'"' : $_} @cmd),"\n" if $VERBOSE;
-system @cmd;
+$_ = system(@cmd);
+my $ex = ($? == 0 and $_ == 0) ? 0 : 1;
close STDOUT;
-exit 0;
+exit $ex;
#################################################################################
#
[ -w "${id}.db" ] || continue
[ "$VERBOSE" -gt 0 ] && printf '%s : ' "$id"
- dbq f=text a=db.dump db.type=sqlite db="$id" 2>/dev/null > "$TMP_DB" || continue
+ dbq f=text a=db.dump db.type=sqlite db="$id" > "$TMP_DB" 2>/dev/null
ret=$?
- if [ ! -s "$TMP_DB" -o "$ret" != "0" ];then
+ if [ "$ret" != "0" -o ! -s "$TMP_DB" ];then
[ "$VERBOSE" -gt 0 ] && echo "failed"
continue
fi
if (!empty($_SERVER['PROD'])) return;
error_reporting(E_ALL | E_STRICT | E_NOTICE);
-ini_set('display_errors', 1);
+if (!nb::php_cli()) ini_set('display_errors', 1);
if (nb::php_cli() or nb::p('txt_errors')) ini_set('html_errors', false);
// Should be done in php.ini for performance