This commit is contained in:
@@ -24,12 +24,25 @@ inline cMode operator|=(cMode & lhs, cMode rhs) {return lhs = lhs | rhs;}
|
||||
inline bool hasFlag(cMode mode, cMode flag) {return (mode & flag) == flag;}
|
||||
|
||||
|
||||
typedef struct sSSHInfo {
|
||||
std::string host;
|
||||
std::string user;
|
||||
std::string port;
|
||||
std::string server_ID; // dropshell name for server.
|
||||
} sSSHInfo;
|
||||
class sSSHInfo {
|
||||
public:
|
||||
sSSHInfo(std::string host, std::string user, std::string port, std::string server_ID, std::string user_dir) :
|
||||
host(host), user(user), port(port), server_ID(server_ID), user_dir(user_dir) {}
|
||||
|
||||
std::string get_host() const { return host; }
|
||||
std::string get_user() const { return user; }
|
||||
std::string get_port() const { return port; }
|
||||
std::string get_server_ID() const { return server_ID; }
|
||||
std::string get_user_dir() const { return user_dir; }
|
||||
|
||||
bool valid() const;
|
||||
private:
|
||||
std::string host;
|
||||
std::string user;
|
||||
std::string port;
|
||||
std::string server_ID; // dropshell name for server.
|
||||
std::string user_dir; // dropshell directory for the user.
|
||||
};
|
||||
|
||||
bool execute_local_command(std::string directory_to_run_in, std::string command_to_run, const std::map<std::string, std::string> & env_vars, std::string * output = nullptr, cMode mode = cMode::Defaults);
|
||||
bool execute_ssh_command(const sSSHInfo & ssh_info, const sCommand & remote_command, cMode mode = cMode::Defaults, std::string * output = nullptr);
|
||||
|
||||
Reference in New Issue
Block a user