F
F
fokin_nikolay19892019-01-15 16:39:10
linux
fokin_nikolay1989, 2019-01-15 16:39:10

How to add value from console?

Dear time of day!
Tell me how to add the DOMAIN=domain.domain parameter to the network interface from the console?
I tried doing like this

echo "DOMAIN=domain.domain" | tee -a /etc/sysconfig/network-scripts/ifcfg-eth0

But unfortunately my interface breaks, restarting the network service,
if I edit it through nano, then in principle everything works, nothing breaks. but because a large number of stations, does not allow using nano, I wanted to do this through bash in the console

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vman, 2019-01-15
@fokin_nikolay1989

> cat ifcfg-eth0
DOMAIN=localhost

> export DOMAIN=local.lan && sed -i '' -e "s|DOMAIN=.*$|DOMAIN=$DOMAIN|" ifcfg-eth0
> cat ifcfg-eth0
DOMAIN=local.lan

A
Alexander, 2019-01-15
@alexr64

Just to add?

echo "DOMAIN=domain.domain" >> /etc/sysconfig/network-scripts/ifcfg-eth0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question