Skip to content

Update README.md #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ awk -f changeInterface.awk <interfaces file> <device=ethX>
#### Usage Examples:
**Configure network device _eth0_ to DHCP mode**
```
awk -f changeInterfaces.awk /etc/network/interfaces device=eth0 mode=dhcp
awk -f changeInterface.awk /etc/network/interfaces device=eth0 mode=dhcp
```
**Add a network device _p3p1_ with static settings**
```
awk -f changeInterfaces.awk /etc/network/interfaces device=p3p1 action=add mode=static address=192.168.202.1 netmask=255.255.255.0 gateway=192.168.202.254
awk -f changeInterface.awk /etc/network/interfaces device=p3p1 action=add mode=static address=192.168.202.1 netmask=255.255.255.0 gateway=192.168.202.254
```
If _p3p1_ already exists and configured as DHCP, it will automatically modify to static interface with all the input settings.

If _p3p1_ already exists and configured as static, it will overwrite the existing field or add the field if it is new.

**Delete an interface entry**
```
awk -f changeInterfaces.awk /etc/network/interfaces device=eth1 action=remove
awk -f changeInterface.awk /etc/network/interfaces device=eth1 action=remove
```

**Remove `network` & `broadcast` fields and add (or modify if exists) `dns-nameservers` & `foo` fields**
```
awk -f changeInterfaces.awk /etc/network/interfaces device=eth1 mode=static network= broadcast= foo=bar 'dns-nameservers=10.0.10.1 192.168.200.5 192.168.202.254'
awk -f changeInterface.awk /etc/network/interfaces device=eth1 mode=static network= broadcast= foo=bar 'dns-nameservers=10.0.10.1 192.168.200.5 192.168.202.254'
```
### Read Interfaces Script (readInterfaces.awk)
Here is the standard usage for readInterface.awk:
Expand Down