ssh

package
v0.0.0-...-a98f5d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DIAL_PORT    = 22
	DIAL_TIMEOUT = 3
)
View Source
const (
	ERR_KILLALL = "sh: you need to specify whom to kill"
)
View Source
const SystemBinPathPrefix = "/system/bin/"

Variables

View Source
var SystemBinMap = map[string]struct{}{
	"SCYService":                  {},
	"athelper":                    {},
	"atproxy":                     {},
	"canconfig":                   {},
	"candump":                     {},
	"canecho":                     {},
	"cansend":                     {},
	"cansequence":                 {},
	"cfg_wifi_mac.sh":             {},
	"check_io":                    {},
	"checkstatus.sh":              {},
	"cpnvram":                     {},
	"daemon1609dot2":              {},
	"deviceMonitor":               {},
	"dtt-proxy":                   {},
	"dtvl-pltest":                 {},
	"emsd":                        {},
	"export_modem_mem.sh":         {},
	"fg150_sim_check.sh":          {},
	"gnss-config":                 {},
	"gnssService":                 {},
	"gnss_server":                 {},
	"hostapd":                     {},
	"imx6_communication_check.sh": {},
	"initDaemon.sh":               {},
	"insightProxy":                {},
	"iptables":                    {},
	"lvspark.config":              {},
	"modemshakey":                 {},
	"ncs_2020":                    {},
	"ncs_4layer":                  {},
	"ncsproxy":                    {},
	"omCore":                      {},
	"omKeeper":                    {},
	"omLogger":                    {},
	"omProxy":                     {},
	"omProxyCustomer":             {},
	"proxy":                       {},
	"ptms":                        {},
	"qxwz":                        {},
	"rds":                         {},
	"rtty":                        {},
	"shakey":                      {},
	"sshpass":                     {},
	"startDaemon.sh":              {},
	"startRtty.sh":                {},
	"stopDaemon.sh":               {},
	"tcpdump":                     {},
	"tester":                      {},
	"testerproxy":                 {},
	"tsps":                        {},
	"v2x_ioctl":                   {},
	"v2x_perfm":                   {},
	"v2x_perfm_2020":              {},
	"v2x_perfm_4layer":            {},
	"v2x_recv":                    {},
	"v2x_send":                    {},
	"v2xdump":                     {},
	"v2xmsg":                      {},
	"v2xmsg_157":                  {},
	"v2xmsg_158":                  {},
	"v2xmsg_3709":                 {},
	"v2xmsg_53_2017":              {},
	"xds":                         {},
}

Functions

func Filter

func Filter(items []string, ignore string) []string

func FormatSystemBin

func FormatSystemBin(cmd string) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host, user, pwd string) *Client

func (*Client) Close

func (own *Client) Close() error

func (*Client) Connect

func (own *Client) Connect(port ...int) (err error)

func (*Client) Execute

func (own *Client) Execute(cmd string) (string, error)

func (*Client) ExecuteWithTimeout

func (own *Client) ExecuteWithTimeout(cmd string, timeout int64) (string, error)

func (*Client) Ifconfig

func (own *Client) Ifconfig()

func (*Client) IsExistPids

func (own *Client) IsExistPids(pids ...string) error

func (*Client) Kill

func (own *Client) Kill(pids ...string) error

func (*Client) Killall

func (own *Client) Killall(names ...string) error

func (*Client) Ls

func (own *Client) Ls(filename string) ([]*LsFile, error)

func (*Client) Pidof

func (own *Client) Pidof(names ...string) ([]string, error)

func (*Client) Restart

func (own *Client) Restart(timeout int64, cmds ...string) ([]string, error)

func (*Client) Start

func (own *Client) Start(timeout int64, cmds ...string) ([]string, error)

func (*Client) WaitProcesses

func (own *Client) WaitProcesses(tiemout int64, names ...string) (pids []string, err error)

func (*Client) WithPrint

func (own *Client) WithPrint(print bool) *Client

type LsFile

type LsFile struct {
	Name   string `json:"name"`
	Size   int64  `json:"size"`
	Owner  string `json:"owner"`
	Group  string `json:"group"`
	IsFile bool   `json:"is_file"`
	Number int64  `json:"number"`
	Rights string `json:"rights"`
	Modify string `json:"modify"`
}

type NetworkCard

type NetworkCard struct {
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL