script: jopdb
This commit is contained in:
parent
f57e7260c6
commit
5b3db778c6
1 changed files with 24 additions and 0 deletions
24
bin/executable_jopdb
Normal file
24
bin/executable_jopdb
Normal 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[@]}" "$@"
|
Loading…
Add table
Reference in a new issue