mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-15 04:21:51 +00:00
Merge pull request #2538 from nzalev/support-different-db-names
Support different db names
This commit is contained in:
commit
af5b58ab0d
1 changed files with 4 additions and 2 deletions
6
db.js
6
db.js
|
@ -1606,7 +1606,8 @@ module.exports.CreateDB = function (parent, func) {
|
||||||
cmd += (parent.platform == 'win32') ? ' --password=\"' + props.password + '\"' : ' --password=\'' + props.password + '\'';
|
cmd += (parent.platform == 'win32') ? ' --password=\"' + props.password + '\"' : ' --password=\'' + props.password + '\'';
|
||||||
if (props.host) { cmd += ' -h ' + props.host; }
|
if (props.host) { cmd += ' -h ' + props.host; }
|
||||||
if (props.port) { cmd += ' -P ' + props.port; }
|
if (props.port) { cmd += ' -P ' + props.port; }
|
||||||
cmd += ' meshcentral > ' + ((parent.platform == 'win32') ? '\"nul\"' : '\"/dev/null\"');
|
var dbname = (props.database) ? props.database : 'meshcentral';
|
||||||
|
cmd += ' ' + dbname + ' > ' + ((parent.platform == 'win32') ? '\"nul\"' : '\"/dev/null\"');
|
||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
child_process.exec(cmd, { cwd: backupPath }, function(error, stdout, stdin) {
|
child_process.exec(cmd, { cwd: backupPath }, function(error, stdout, stdin) {
|
||||||
try {
|
try {
|
||||||
|
@ -1806,7 +1807,8 @@ module.exports.CreateDB = function (parent, func) {
|
||||||
cmd += (parent.platform == 'win32') ? ' --password=\"' + props.password + '\"' : ' --password=\'' + props.password + '\'';
|
cmd += (parent.platform == 'win32') ? ' --password=\"' + props.password + '\"' : ' --password=\'' + props.password + '\'';
|
||||||
if (props.host) { cmd += ' -h ' + props.host; }
|
if (props.host) { cmd += ' -h ' + props.host; }
|
||||||
if (props.port) { cmd += ' -P ' + props.port; }
|
if (props.port) { cmd += ' -P ' + props.port; }
|
||||||
cmd += ' meshcentral --result-file=\"' + newBackupPath + '.sql\"';
|
var sqldbname = (props.database) ? props.database : 'meshcentral';
|
||||||
|
cmd += ' ' + sqldbname + ' --result-file=\"' + newBackupPath + '.sql\"';
|
||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
var backupProcess = child_process.exec(cmd, { cwd: backupPath }, function (error, stdout, stderr) {
|
var backupProcess = child_process.exec(cmd, { cwd: backupPath }, function (error, stdout, stderr) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue