Adds hosts

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

Adds hosts

Post 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 ^
sadim
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 691
Joined: 02 Jun 2006 07:11
Location: Portugal

Re: Adds hosts

Post by sadim »

Hi,
Just add the host(s) to the hosts files.
Regards
User avatar
tgn
Member
Posts: 802
Joined: 30 Dec 2009 17:59
Location: Germany

Re: Adds hosts

Post 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...
--- 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 »

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: 802
Joined: 30 Dec 2009 17:59
Location: Germany

Re: Adds hosts

Post 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...
User avatar
stryk
Member
Posts: 5
Joined: 15 May 2017 06:59

Re: Adds hosts

Post by stryk »

One who work ^
I would like to work netadmin ...
sadim
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 691
Joined: 02 Jun 2006 07:11
Location: Portugal

Re: Adds hosts

Post by sadim »

Hi,
check your private messages
Regards
User avatar
stryk
Member
Posts: 5
Joined: 15 May 2017 06:59

Re: Adds hosts

Post by stryk »

Answered ;)
Post Reply

Return to “Linux tricks”