Skip to content

Commit

Permalink
Don't offer * as configured interface when there are none
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Apr 22, 2017
1 parent 537c9a0 commit c287bb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -906,17 +906,17 @@ _configured_interfaces()
# SuSE system
COMPREPLY=( $( compgen -W "$( printf '%s\n' \
/etc/sysconfig/network/ifcfg-* | \
command sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) )
command sed -ne 's|.*ifcfg-\([^*].*\)$|\1|p' )" -- "$cur" ) )
elif [[ -f /etc/pld-release ]]; then
# PLD Linux
COMPREPLY=( $( compgen -W "$( command ls -B \
/etc/sysconfig/interfaces | \
command sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) )
command sed -ne 's|.*ifcfg-\([^*].*\)$|\1|p' )" -- "$cur" ) )
else
# Assume Red Hat
COMPREPLY=( $( compgen -W "$( printf '%s\n' \
/etc/sysconfig/network-scripts/ifcfg-* | \
command sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) )
command sed -ne 's|.*ifcfg-\([^*].*\)$|\1|p' )" -- "$cur" ) )
fi
}

Expand Down

0 comments on commit c287bb2

Please sign in to comment.