joekuan / network-interfaces-script Goto Github PK
View Code? Open in Web Editor NEWTwo awk scripts - one for updating Ubuntu 14 network interfaces file, one for reading the interfaces file
License: MIT License
Two awk scripts - one for updating Ubuntu 14 network interfaces file, one for reading the interfaces file
License: MIT License
USEFUL AWK ~~~
root@ubuntu:~/Desktop/Network-Interfaces-Script-master# awk -f changeInterface.awk /etc/network/interfaces device=ens33 action=add mode=static address=192.168.239.149 netmask=255.255.255.0 gateway=192.168.239.254
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.239.149
netmask 255.255.255.0
gateway 192.168.239.254
root@ubuntu:~/Desktop/Network-Interfaces-Script-master# awk -f changeInterface.awk /etc/network/interfaces device=ens34 action=add mode=static address=192.168.1.1 netmask=255.255.255.0
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.239.149
netmask 255.255.255.0
gateway 192.168.239.254
auto ens34
iface ens34 inet static
netmask 255.255.255.0
address 192.168.1.1
root@ubuntu:~/Desktop/Network-Interfaces-Script-master# awk -f changeInterface.awk /etc/network/interfaces device=ens33 action=add mode=static address=192.168.239.149 netmask=255.255.255.0 gateway=192.168.239.254
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.239.149
netmask 255.255.255.0
gateway 192.168.239.254
awk: ./bin/changeInterface.awk: line 5: illegal reference to local variable orders awk: ./bin/changeInterface.awk: line 51: illegal reference to array pair awk: ./bin/changeInterface.awk: line 155: illegal reference to variable fieldOrders
Receiving this series of errors whenever I try to execute the changeInterface script.
Have you ran across this before? I was looking for a simple way to wrap some networking changes around a node API and kept coming back to your scripts.
Thanks much,
Thank you for your awesome scripts.
But, your script doesn't work as I thought.
Both static and dhcp can have dns-nameservers.
But below example command didn't working.
awk -f changeInterface.awk /etc/network/interfaces dev=eth0 mode=dhcp dns=210.220.163.82
I think that in case of dhcp, your script didn't set dns.
I see that you have a very useful remove mode, but it isn't reflected in the github version. it is correct I think on your web site, could you put it in here please. Thanks so much for the hard work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.