Adds hosts

Post Reply
User avatar
stryk
Member
Posts: 5
Joined: 15 May 2017 06:59

Adds hosts

Post by stryk » 18 Sep 2017 02:25

Hi,

I try to write a script that adds hosts, like this:

Code: Select all

echo "9\n1\n2\nxa00001\n192.168.69.69\n0\n0\n18\n0\n" | netadmin -m
But this code don't work: "ERROR tcgetattr"
What's that ? :lol:

you have an idea to write it otherwise?

Thanks ^

sadim
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 500
Joined: 02 Jun 2006 07:11
Location: Portugal

Re: Adds hosts

Post by sadim » 20 Sep 2017 10:16

Hi,
Just add the host(s) to the hosts files.
Regards

User avatar
tgn
Member
Posts: 793
Joined: 30 Dec 2009 17:59
Location: Germany

Re: Adds hosts

Post by tgn » 20 Sep 2017 12:01

sadim wrote:Hi,
Just add the host(s) to the hosts files.
Regards
not a good idea.
netadmin covers more than just entries in /etc/hosts


regards...
--- back to basics... focus your eyes to the essential things... ---

User avatar
stryk
Member
Posts: 5
Joined: 15 May 2017 06:59

Re: Adds hosts

Post by stryk » 20 Sep 2017 12:17

Hi Sadim,

I thought about it but /etc/hosts file is denied for mtcl account ... And my script run in mtcl !
Sudo don't work either ...
Else, yes this code work good in root user:

Code: Select all

echo -e "192.169.69.69	xa00001" >> /etc/hosts
finally i'll use a correct command into rsh command for adds all hosts to all nodes.

User avatar
tgn
Member
Posts: 793
Joined: 30 Dec 2009 17:59
Location: Germany

Re: Adds hosts

Post by tgn » 21 Sep 2017 03:39

stryk wrote:
20 Sep 2017 12:17
finally i'll use a correct command into rsh command for adds all hosts to all nodes.
trough netadmin? or trough echo "something" >> /etc/hosts?

regards...

User avatar
stryk
Member
Posts: 5
Joined: 15 May 2017 06:59

Re: Adds hosts

Post by stryk » 21 Sep 2017 12:22

One who work ^
I would like to work netadmin ...

sadim
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 500
Joined: 02 Jun 2006 07:11
Location: Portugal

Re: Adds hosts

Post by sadim » 22 Sep 2017 04:57

Hi,
check your private messages
Regards

User avatar
stryk
Member
Posts: 5
Joined: 15 May 2017 06:59

Re: Adds hosts

Post by stryk » 22 Sep 2017 07:18

Answered ;)

Post Reply

Return to “Linux tricks”