Exemplo n.º 1
0
        public RebootQuery(IClientSsh client, string sudoPassword) : base(client)
        {
            var sb = new StringBuilder();

            if (!string.IsNullOrEmpty(sudoPassword))
            {
                sb.AppendFormat("echo \"{0}\" | sudo -S /sbin/shutdown -h now", sudoPassword);
            }
            //TODO : using halte command
        }
Exemplo n.º 2
0
        public HaltSignalQuery(IClientSsh client, string sudoPassword) : base(client)
        {
            _sudoPassword = sudoPassword;

            var sb = new StringBuilder();

            if (!string.IsNullOrEmpty(sudoPassword))
            {
                sb.AppendFormat("echo \"{0}\" | sudo -S /sbin/shutdown -r now", _sudoPassword);
                //TODO : using halte command
            }
        }
Exemplo n.º 3
0
 public FreqQuery(IClientSsh client, string vcgencmdPath, int unit) : base(client)
 {
     _vcgencmdPath = vcgencmdPath;
     _unit         = unit;
     CmdString     = _vcgencmdPath + FREQ_CMD;
     if (_unit == FREQ_ARM)
     {
         CmdString += " arm";
     }
     else if (_unit == FREQ_CORE)
     {
         CmdString += " core";
     }
 }
 public KillProcessQuery(IClientSsh client, int pid) : base(client)
 {
     CmdString = $"kill {pid}";
 }
Exemplo n.º 5
0
 public VcgencmdQuery(IClientSsh client) : base(client)
 {
     CmdString = "vcgencmd";
 }
Exemplo n.º 6
0
 public GenericBashQuery(IClientSsh client, string cmdString) : this(client)
 {
     //CmdString = cmdString;
     CmdString = string.Format(_bashCmd, cmdString);
 }
Exemplo n.º 7
0
 public CpuTempQuery(IClientSsh client, string vcgencmdPath) : base(client)
 {
     _vcgencmdPath = vcgencmdPath;
     CmdString     = _vcgencmdPath + CPUTEMP_CMD;
 }
Exemplo n.º 8
0
 public ProcessesQuery(IClientSsh client, bool showRootProcesses) : base(client)
 {
     CmdString = showRootProcesses ? PROCESS_ALL : PROCESS_NO_ROOT_CMD;
 }
Exemplo n.º 9
0
 public UmountQuery(IClientSsh client, string device) : base(client)
 {
     CmdString = $"umount {device}";
 }
Exemplo n.º 10
0
 public LoadAverageQuery(IClientSsh client, LoadAveragePeriod period) : base(client)
 {
     _period   = period;
     CmdString = LOAD_AVG_CMD;
 }
Exemplo n.º 11
0
 public IpAddressQuery(IClientSsh client, string name) : base(client)
 {
     CmdString = "ip -f inet addr show dev " + name + " | sed -n 2p";
     _name     = name;
 }
Exemplo n.º 12
0
 public InterfaceQuery(IClientSsh client) : base(client)
 {
     CmdString = "ls -1 /sys/class/net";
 }
 public GetListFileBaseQuery(IClientSsh client, string path) : base(client)
 {
     _path     = path;
     _query    = $"ls -l {_path} --time-style=long-iso";
     CmdString = _query;
 }
Exemplo n.º 14
0
 public VoltsQuery(IClientSsh client, string vcgencmdPath) : base(client)
 {
     _vcgencmdPath = vcgencmdPath;
     CmdString     = _vcgencmdPath + VOLTS_CMD;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="client">the client</param>
 /// <param name="cmd">The command to execut with nohup</param>
 /// <returns>The command's pid</returns>
 public NoHupQuery(IClientSsh client, string cmd) : base(client)
 {
     CmdString = $"nohup {cmd} >/dev/null 2>&1 </dev/null & echo {ReturnQuery.ResultPid} $! &";
     //CmdString = $"nohup {cmd} >/dev/null 2>&1 &";
 }
Exemplo n.º 16
0
 public WlanInfoQuery(IClientSsh client, List <NetworkInterfaceInformationBean> wirelessInterfaces) : base(client)
 {
     CmdString           = "cat /proc/net/wireless";
     _wirelessInterfaces = wirelessInterfaces;
 }
Exemplo n.º 17
0
 public UptimeQuery(IClientSsh client) : base(client)
 {
     CmdString = UPTIME_CMD;
 }
Exemplo n.º 18
0
 public DiskUsageQuery(IClientSsh client) : base(client)
 {
     CmdString = DISK_USAGE_CMD;
 }
Exemplo n.º 19
0
 public SystemInfoQueries(IClientSsh client) : base(client)
 {
     Action = CreateSystemBean;
 }
Exemplo n.º 20
0
 public LastloginsQuery(IClientSsh client) : base(client)
 {
     CmdString = "last -a | head -3";
 }
Exemplo n.º 21
0
 public DistributionNameQuery(IClientSsh client) : base(client)
 {
     CmdString = DISTRIBUTION_CMD;
 }
Exemplo n.º 22
0
 public GetLogsListQuery(IClientSsh client) : base(client, Path)
 {
 }
Exemplo n.º 23
0
 public UpdateQuery(IClientSsh client) : base(client)
 {
     CmdString = Query;
 }
Exemplo n.º 24
0
 public CpuInfoQuery(IClientSsh client) : base(client)
 {
     CmdString = CpuInfoRequest.RequestString;
 }
Exemplo n.º 25
0
 public GenericBashQuery(IClientSsh client)
 {
     Client = client;
 }
Exemplo n.º 26
0
 public FirmwareQuery(IClientSsh client, string vcgencmdPath) : base(client)
 {
     _vcgencmdPath = vcgencmdPath;
     CmdString     = _vcgencmdPath + " version";
 }
Exemplo n.º 27
0
 public AllYesQuery(IClientSsh client, string command) : base(client)
 {
     CmdString = $"yes \"\" | {command}";
 }
Exemplo n.º 28
0
 public AptListQuery(IClientSsh client) : base(client)
 {
     CmdString = UpgradableRequest.RequestString;
 }
 public NetworkInformationQuery(IClientSsh client) : base(client)
 {
     CmdString = "ls -1 /sys/class/net";
 }
Exemplo n.º 30
0
 public NetstatQuery(IClientSsh client) : base(client)
 {
     CmdString = "netstat -a -inet";
 }