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
        }
Example #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
            }
        }
Example #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}";
 }
Example #5
0
 public VcgencmdQuery(IClientSsh client) : base(client)
 {
     CmdString = "vcgencmd";
 }
Example #6
0
 public GenericBashQuery(IClientSsh client, string cmdString) : this(client)
 {
     //CmdString = cmdString;
     CmdString = string.Format(_bashCmd, cmdString);
 }
Example #7
0
 public CpuTempQuery(IClientSsh client, string vcgencmdPath) : base(client)
 {
     _vcgencmdPath = vcgencmdPath;
     CmdString     = _vcgencmdPath + CPUTEMP_CMD;
 }
Example #8
0
 public ProcessesQuery(IClientSsh client, bool showRootProcesses) : base(client)
 {
     CmdString = showRootProcesses ? PROCESS_ALL : PROCESS_NO_ROOT_CMD;
 }
Example #9
0
 public UmountQuery(IClientSsh client, string device) : base(client)
 {
     CmdString = $"umount {device}";
 }
 public LoadAverageQuery(IClientSsh client, LoadAveragePeriod period) : base(client)
 {
     _period   = period;
     CmdString = LOAD_AVG_CMD;
 }
Example #11
0
 public IpAddressQuery(IClientSsh client, string name) : base(client)
 {
     CmdString = "ip -f inet addr show dev " + name + " | sed -n 2p";
     _name     = name;
 }
Example #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;
 }
Example #14
0
 public VoltsQuery(IClientSsh client, string vcgencmdPath) : base(client)
 {
     _vcgencmdPath = vcgencmdPath;
     CmdString     = _vcgencmdPath + VOLTS_CMD;
 }
Example #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 &";
 }
Example #16
0
 public WlanInfoQuery(IClientSsh client, List <NetworkInterfaceInformationBean> wirelessInterfaces) : base(client)
 {
     CmdString           = "cat /proc/net/wireless";
     _wirelessInterfaces = wirelessInterfaces;
 }
Example #17
0
 public UptimeQuery(IClientSsh client) : base(client)
 {
     CmdString = UPTIME_CMD;
 }
Example #18
0
 public DiskUsageQuery(IClientSsh client) : base(client)
 {
     CmdString = DISK_USAGE_CMD;
 }
 public SystemInfoQueries(IClientSsh client) : base(client)
 {
     Action = CreateSystemBean;
 }
Example #20
0
 public LastloginsQuery(IClientSsh client) : base(client)
 {
     CmdString = "last -a | head -3";
 }
Example #21
0
 public DistributionNameQuery(IClientSsh client) : base(client)
 {
     CmdString = DISTRIBUTION_CMD;
 }
 public GetLogsListQuery(IClientSsh client) : base(client, Path)
 {
 }
Example #23
0
 public UpdateQuery(IClientSsh client) : base(client)
 {
     CmdString = Query;
 }
Example #24
0
 public CpuInfoQuery(IClientSsh client) : base(client)
 {
     CmdString = CpuInfoRequest.RequestString;
 }
Example #25
0
 public GenericBashQuery(IClientSsh client)
 {
     Client = client;
 }
Example #26
0
 public FirmwareQuery(IClientSsh client, string vcgencmdPath) : base(client)
 {
     _vcgencmdPath = vcgencmdPath;
     CmdString     = _vcgencmdPath + " version";
 }
Example #27
0
 public AllYesQuery(IClientSsh client, string command) : base(client)
 {
     CmdString = $"yes \"\" | {command}";
 }
Example #28
0
 public AptListQuery(IClientSsh client) : base(client)
 {
     CmdString = UpgradableRequest.RequestString;
 }
 public NetworkInformationQuery(IClientSsh client) : base(client)
 {
     CmdString = "ls -1 /sys/class/net";
 }
 public NetstatQuery(IClientSsh client) : base(client)
 {
     CmdString = "netstat -a -inet";
 }