1
0
Fork 0

script: jopdb

This commit is contained in:
Vladimír Dudr 2022-12-27 11:17:19 +01:00
parent f57e7260c6
commit 5b3db778c6

24
bin/executable_jopdb Normal file
View file

@ -0,0 +1,24 @@
#!/bin/bash
:<<'PHP'
<?php
$root = trim(shell_exec('git rev-parse --show-toplevel'));
require $root.'/www/app/config/database.cfg.d/connections.cfg.d/basic.cfg.php';
echo implode(' ', [
'-h', $config['host'],
'-u', $config['user'],
'-p'.$config['password'],
$config['db'],
]);
__halt_compiler();
PHP
read -ra cmd < <(php "$0" |tail -n1)
run="${1:-mysql}"
shift
exec $run "${cmd[@]}" "$@"