Skip to content

Commit 969b97a

Browse files
bigiobrycied00d
authored andcommitted
Add a [-n] optional parameter, dhcp will not be invoked, to be used with trunk(4) (#9)
Add a [-n] optional parameter, dhcp will not be invoked, to be used with trunk(4)
1 parent 2b0f057 commit 969b97a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

wiconfig

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# wiconfig - simplifies the configuration of wireless interfaces
2424
#
2525
# SYNOPSIS
26-
# wiconfig [-dqs] interface
26+
# wiconfig [-dnqs] interface
2727
#
2828
# EXAMPLE
2929
# Manually configure a wireless interface
@@ -82,7 +82,7 @@ seconds=3
8282
wiconfigdb="/etc/wiconfig.db"
8383

8484
function usage {
85-
echo "usage: $myname [-dqs] interface"
85+
echo "usage: $myname [-dnqs] interface"
8686
exit 1
8787
}
8888

@@ -357,7 +357,9 @@ function configure {
357357
# Apparently we need to use eval and single quotes to handle nwids with
358358
# spaces
359359
eval ifconfig $if nwid \'$1\' $2 up > /dev/null 2>&1
360-
dhclient $if
360+
if [ ! $nodhcp ]; then
361+
dhclient $if
362+
fi
361363
}
362364

363365
function reconnect {
@@ -441,7 +443,9 @@ function determine {
441443
exit 1
442444
fi
443445
fi
444-
dhclient $if
446+
if [ ! $nodhcp ]; then
447+
dhclient $if
448+
fi
445449
}
446450

447451
# Update existing db record, if it exists, or create a new one
@@ -528,9 +532,10 @@ if [ "X$(whoami)" != Xroot ]; then
528532
exit 1
529533
fi
530534

531-
while getopts dqs opt; do
535+
while getopts dnqs opt; do
532536
case $opt in
533537
d) debug=true;;
538+
n) nodhcp=true;;
534539
q) quiet=true;;
535540
s) status=true;;
536541
?) usage;;

0 commit comments

Comments
 (0)