Page 1 of 1

Adds hosts

Posted: 18 Sep 2017 02:25
by stryk
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 ^

Re: Adds hosts

Posted: 20 Sep 2017 10:16
by sadim
Hi,
Just add the host(s) to the hosts files.
Regards

Re: Adds hosts

Posted: 20 Sep 2017 12:01
by tgn
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...

Re: Adds hosts

Posted: 20 Sep 2017 12:17
by stryk
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.

Re: Adds hosts

Posted: 21 Sep 2017 03:39
by tgn
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...

Re: Adds hosts

Posted: 21 Sep 2017 12:22
by stryk
One who work ^
I would like to work netadmin ...

Re: Adds hosts

Posted: 22 Sep 2017 04:57
by sadim
Hi,
check your private messages
Regards

Re: Adds hosts

Posted: 22 Sep 2017 07:18
by stryk
Answered ;)