printf '#!%s\n%s\n' `which sh` 'ssh -o BatchMode=yes $@' > "$TMP" && chmod 755 "$TMP"
export GIT_SSH="$TMP"
-errors=''
for repo in $(nb-repo-dirs); do
# NB 17.01.16 # Check dir
if [ "$ret" != "0" ]; then
ex=$ret && echo ">err $ret"
- errors="$errors\n$cmd"
else
cmd_root="true"
[ -x bin/$name-install ] && cmd_root="$cmd_root && echo ' >$name-install' && bin/$name-install|sed 's/^/ /'"
#[ "$cmd_root" == "true" ] || eval "$cmd_root" || echo ">err"
- if [ "$cmd_root" != "true" ] && ! eval "$cmd_root"; then
+ if [ "$cmd_root" != "true" ]; then
+ eval "$cmd_root"
ex=$?
- echo ">err"
- errors="$errors\n$cmd_root"
+ [ "$ex" -gt "0" ] && echo ">err"
fi
fi
printf ">OK\n"
else
printf ">ERR\n"
- [ -n "$errors" ] && printf "$errors" | mail -s "$NAME" -- nico@nbdom.net
fi
exit $ex
#####################################################################
# m h dom mon dow user command
#
-*/15 09-23 * * * root nb-update >/var/log/nb.log 2>&1
-0 00-08 * * * root nb-update >/var/log/nb.log 2>&1
+*/15 09-23 * * * root nb-update >/var/log/nb.log 2>&1 || cat /var/log/nb.log
+0 00-08 * * * root nb-update >/var/log/nb.log 2>&1 || cat /var/log/nb.log
'password' => 'mpc60ax73',
'type' => 'mysql',
'name' => 'nb',
+ 'default_table' => 'rent',
'tables' => array(
-
+ 'rent' => array(
+ 'order_by' => 'start desc',
+ 'replace' => array (
+ 'idtenant' => 'tenant.name',
+ 'idplace' => 'addr.addr',
+ ),
+ 'columns' => array (
+ 'total' => function(&$r) {$r['rent'] + $r['charge'];}
+ ),
+ ),
),
),
'puppetdb' => array (