mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Merge branch 'master' of github.com:pcbsd/sysadm
This commit is contained in:
@@ -1,18 +1,3 @@
|
||||
bin/sysadm
|
||||
bin/sysadm-server
|
||||
etc/rc.d/sysadm-restserver
|
||||
etc/rc.d/sysadm-websocket
|
||||
include/sysadm-firewall.h
|
||||
include/sysadm-general.h
|
||||
include/sysadm-global.h
|
||||
include/sysadm-iocage.h
|
||||
include/sysadm-lifepreserver.h
|
||||
include/sysadm-network.h
|
||||
include/sysadm-servicemanager.h
|
||||
include/sysadm-systeminfo.h
|
||||
include/sysadm-update.h
|
||||
include/sysadm-usermanager.h
|
||||
%%QT_LIBDIR%%/%%QT_LIBDIR%%sysadm.so
|
||||
%%QT_LIBDIR%%/%%QT_LIBDIR%%sysadm.so.1
|
||||
%%QT_LIBDIR%%/%%QT_LIBDIR%%sysadm.so.1.0
|
||||
%%QT_LIBDIR%%/%%QT_LIBDIR%%sysadm.so.1.0.0
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
// Available under the 3-clause BSD license
|
||||
// See the LICENSE file for full details
|
||||
//===========================================
|
||||
#include <QUuid>
|
||||
#include "sysadm-general.h"
|
||||
#include "sysadm-lifepreserver.h"
|
||||
#include "sysadm-global.h"
|
||||
#include "globals.h"
|
||||
|
||||
using namespace sysadm;
|
||||
|
||||
@@ -388,22 +390,16 @@ QJsonObject LifePreserver::runReplication(QJsonObject jsin) {
|
||||
return retObject;
|
||||
}
|
||||
|
||||
QStringList output;
|
||||
output = General::RunCommand("lpreserver replicate run " + dataset + " " + host).split("\n");
|
||||
|
||||
// Check for any errors
|
||||
for ( int i = 0; i < output.size(); i++)
|
||||
{
|
||||
if ( output.at(i).indexOf("ERROR:") != -1 ) {
|
||||
retObject.insert("error", output.at(i));
|
||||
return retObject;
|
||||
}
|
||||
}
|
||||
// Create a unique ID for this queued action
|
||||
QString ID = QUuid::createUuid().toString();
|
||||
|
||||
DISPATCHER->queueProcess(ID, "lpreserver replicate run " + dataset + " " + host);
|
||||
|
||||
// Got to the end, return the good json
|
||||
QJsonObject values;
|
||||
values.insert("dataset", dataset);
|
||||
values.insert("host", host);
|
||||
values.insert("queueid", ID);
|
||||
values.insert("command", "lpreserver replicate run " + dataset + " " + host);
|
||||
values.insert("comment", "Task Queued");
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,8 @@ if [ $? -ne 0 ] ; then
|
||||
echo "Failed.. Error output:"
|
||||
cat /tmp/.rstErr
|
||||
fi
|
||||
|
||||
rm $ofile
|
||||
rm /tmp/.rstErr
|
||||
|
||||
# Now check the response via WebSockets
|
||||
export NODE_TLS_REJECT_UNAUTHORIZED=0
|
||||
@@ -109,3 +110,4 @@ echo "" | tee -a $ofile
|
||||
echo "WebSocket Response:" | tee -a $ofile
|
||||
echo "-------------------------------" | tee -a $ofile
|
||||
echo "{ \"namespace\":\"${namesp}\", \"name\":\"${name}\", \"id\":\"fooid\", \"args\":${payload} }" | node sendwebsocket.js "$fuser" "$fpass" | tee -a $ofile
|
||||
rm $ofile
|
||||
|
||||
Reference in New Issue
Block a user