2010-06-09 22:53:43 +03:00
|
|
|
# Red Hat & Debian GNU/Linux if{up,down} completion
|
|
|
|
#
|
2011-04-05 00:35:51 +03:00
|
|
|
[ $USERLAND = GNU ] && have ifup || have ifdown || return
|
|
|
|
|
2010-06-09 22:53:43 +03:00
|
|
|
_ifupdown()
|
|
|
|
{
|
2011-04-20 17:13:48 +03:00
|
|
|
local cur prev words cword
|
|
|
|
_init_completion || return
|
2010-06-09 22:53:43 +03:00
|
|
|
|
2011-04-21 11:16:11 +03:00
|
|
|
if [ $cword -eq 1 ]; then
|
2010-06-09 22:53:43 +03:00
|
|
|
_configured_interfaces
|
|
|
|
COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
} &&
|
|
|
|
complete -F _ifupdown ifup ifdown
|
2011-04-04 23:52:56 +03:00
|
|
|
|
|
|
|
have ifstatus && complete -F _ifupdown ifstatus
|
2010-06-09 22:53:43 +03:00
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: shell-script
|
|
|
|
# sh-basic-offset: 4
|
|
|
|
# sh-indent-comment: t
|
|
|
|
# indent-tabs-mode: nil
|
|
|
|
# End:
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|