-a, -ip Change the IP address
-n, -netmask Change the netmask
-g, -gw, -gateway Change the default gateway
-i, -interface Change the interface on which change the specifications. Default is your ethernet one
-d, -dns Change the dns server
--no-ip Don't modify the ip
--no-netmask Don't modify the netmask
--no-gw, --no-gateway Don't modify the default gateway
--no-dns Don't modify the dns server
--default-values Change the ip, netmask, gateway, dns to default values. If no other options are specified:
ip: 192.168.1.160
netmask: 255.255.255.0
gateway: 192.168.1.1
dns: 192.168.1.1
interface: your ethernet one
./setup.sh -ip 175.15.8.12 -netmask 255.255.255.0
# or
./setup.sh -ip 175.15.8.12 -netmask 24
./setup.sh -gw 192.168.5.1 -dns 192.168.6.200
Change the configuration to default values without modifying the current ip and set the dns to 192.168.1.200
./setup.sh --default-values --no-ip -d 192.168.1.200
- All the options have the priority on
--default-values
one - If using, for example,
-ip
or-a
and--no-ip
flags together, the last one has the priority:
./setup.sh -a <ip> --no-ip # no ip changed
./setup.sh --no-ip -a <ip> # ip changed to <ip>
You can contribute in any way. One of the things i'd like to implement are
- get rid of the
ifconfig
command and only useip
one - Allow user to set netmask and ip separately even with
ip
command - Allow user to set the netmask as prefix length or as
x.x.x.x
- Avoid displaying error message when, for example, no argument are passed to
tr
incount()
function. Use customs one instead