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 }
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 } }
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}"; }
public VcgencmdQuery(IClientSsh client) : base(client) { CmdString = "vcgencmd"; }
public GenericBashQuery(IClientSsh client, string cmdString) : this(client) { //CmdString = cmdString; CmdString = string.Format(_bashCmd, cmdString); }
public CpuTempQuery(IClientSsh client, string vcgencmdPath) : base(client) { _vcgencmdPath = vcgencmdPath; CmdString = _vcgencmdPath + CPUTEMP_CMD; }
public ProcessesQuery(IClientSsh client, bool showRootProcesses) : base(client) { CmdString = showRootProcesses ? PROCESS_ALL : PROCESS_NO_ROOT_CMD; }
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; }
public IpAddressQuery(IClientSsh client, string name) : base(client) { CmdString = "ip -f inet addr show dev " + name + " | sed -n 2p"; _name = name; }
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; }
public VoltsQuery(IClientSsh client, string vcgencmdPath) : base(client) { _vcgencmdPath = vcgencmdPath; CmdString = _vcgencmdPath + VOLTS_CMD; }
/// <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 &"; }
public WlanInfoQuery(IClientSsh client, List <NetworkInterfaceInformationBean> wirelessInterfaces) : base(client) { CmdString = "cat /proc/net/wireless"; _wirelessInterfaces = wirelessInterfaces; }
public UptimeQuery(IClientSsh client) : base(client) { CmdString = UPTIME_CMD; }
public DiskUsageQuery(IClientSsh client) : base(client) { CmdString = DISK_USAGE_CMD; }
public SystemInfoQueries(IClientSsh client) : base(client) { Action = CreateSystemBean; }
public LastloginsQuery(IClientSsh client) : base(client) { CmdString = "last -a | head -3"; }
public DistributionNameQuery(IClientSsh client) : base(client) { CmdString = DISTRIBUTION_CMD; }
public GetLogsListQuery(IClientSsh client) : base(client, Path) { }
public UpdateQuery(IClientSsh client) : base(client) { CmdString = Query; }
public CpuInfoQuery(IClientSsh client) : base(client) { CmdString = CpuInfoRequest.RequestString; }
public GenericBashQuery(IClientSsh client) { Client = client; }
public FirmwareQuery(IClientSsh client, string vcgencmdPath) : base(client) { _vcgencmdPath = vcgencmdPath; CmdString = _vcgencmdPath + " version"; }
public AllYesQuery(IClientSsh client, string command) : base(client) { CmdString = $"yes \"\" | {command}"; }
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"; }