2019-04-19 22:59:21 +00:00
|
|
|
#!/bin/sh -e
|
2012-05-29 11:11:42 +00:00
|
|
|
#
|
2019-04-19 22:59:21 +00:00
|
|
|
# 2019 Ander Punnar (ander-at-kvlt-dot-ee)
|
2012-05-29 11:11:42 +00:00
|
|
|
#
|
|
|
|
# This file is part of cdist.
|
|
|
|
#
|
|
|
|
# cdist is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# cdist is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
2019-10-02 16:09:39 +00:00
|
|
|
if command -v ip >/dev/null
|
2019-04-19 22:59:21 +00:00
|
|
|
then
|
2019-10-02 16:09:39 +00:00
|
|
|
ip -o link show | sed -n 's/^[0-9]\+: \(.\+\): <.*/\1/p'
|
|
|
|
elif command -v ifconfig >/dev/null
|
2019-04-19 22:59:21 +00:00
|
|
|
then
|
2019-10-02 16:09:39 +00:00
|
|
|
ifconfig -a | sed -n -E 's/^(.*)(:[[:space:]]*flags=|Link encap).*/\1/p'
|
|
|
|
fi \
|
|
|
|
| sort -u
|