mirror of
https://github.com/appleboy/drone-ssh.git
synced 2026-02-05 09:10:09 +08:00
print error when running command, fix default port comment
This commit is contained in:
3
main.go
3
main.go
@@ -32,6 +32,7 @@ func main() {
|
|||||||
for i, host := range v.Host.Slice() {
|
for i, host := range v.Host.Slice() {
|
||||||
err := run(w.Keys, v, host)
|
err := run(w.Keys, v, host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
if v.Sleep != 0 && i != v.Host.Len()-1 {
|
if v.Sleep != 0 && i != v.Host.Len()-1 {
|
||||||
@@ -48,7 +49,7 @@ func run(keys *plugin.Keypair, params *Params, host string) error {
|
|||||||
params.Login = "root"
|
params.Login = "root"
|
||||||
}
|
}
|
||||||
|
|
||||||
// if no username is provided assume root
|
// if no port is provided use default
|
||||||
if params.Port == 0 {
|
if params.Port == 0 {
|
||||||
params.Port = 22
|
params.Port = 22
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user