Re: remote ssh commands

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/plain)
Delete this message
Reply to this message
Author: der.hans
Date:  
To: Main PLUG discussion list
Subject: Re: remote ssh commands
Am 31. May, 2016 schwätzte Nadim Hoque so:

moin moin Nadim,

as Brian mentioned it sounds like ou might have a blank line in the file.

ssh ${server:-pleasedonotusethisasahostname}.localdomain 'yum update -y &&
poweroff'

Or just verify that you have a valid value before using it :).

ciao,

der.hans

> Fellow Pluggers,
>
> So I am trying to perform a remote poweroff command and for some reason the
> host powers itself off. I am able to run another command such as yum just
> fine but when I try to execute the poweroff command the host turns off as
> well. Below is the script that I am running
>
>
>
> #!/bin/bash
>
> for server in $(cat serverlist.txt); do
>       ssh $server.localdomain 'yum update -y && poweroff'
> done

>
> Also note that the serverlist.txt does not contain the host itself. Thanks
> for the help.
>
> Nadim Hoque
>


-- 
#  http://www.LuftHans.com/        http://www.PhxLinux.org/
#  A t-shirt a day keeps the noose away. - der.hans
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss