1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#ifndef INCLUDED_SSHCRON_
#define INCLUDED_SSHCRON_
#include <memory>
#include <bobcat/fork>
#include <bobcat/localclientsocket>
#include "../udsreq/udsreq.h"
namespace FBB
{
class IFdStream;
class OFdStream;
}
class Options;
class SSHCron: public FBB::Fork, private UDSReq
{
Options &d_options;
FBB::LocalClientSocket d_client;
std::string d_passphrase;
std::unique_ptr<FBB::IFdStream> d_in;
std::unique_ptr<FBB::OFdStream> d_out;
public:
SSHCron();
~SSHCron() override;
void run();
private:
void childProcess() override;
void parentProcess() override;
void askPassphrase();
std::ostream &basename() const; // options.msg() inserts basename :
void toCron(); // commands to the child, e.g., --list
void daemon(); // run the daemon in the background
void foreground();
void getPassphrase();
std::ostream &idmsg() const; // imsg inserts "'basename' : "
void list();
void reload();
void terminate();
};
#endif
|