1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-14 17:13:50 +01:00

35 lines
1.1 KiB
Bash
Executable File

#! /bin/sh
#
# check_config.sh
# SPDX-FileCopyrightText: 2021 Martine Lenders <mail@martine-lenders.eu>
# SPDX-FileCopyrightText: 2022 Inria
# SPDX-License-Identifier: MIT
ip link show dev "${IFACE}" > /dev/null
RESULT=$?
if [ $RESULT -eq 0 ]; then
if [ "${BOARD}" = "native" ] || [ "${BOARD}" = "native64" ]; then
IFACE_IPV6_ADDR=$(ip -6 addr show dev "${IFACE}"| grep inet6 | \
awk -F '[ \t]+|/' '{print $3}' | grep -v ^::1 | \
grep -v ^fe80)
if [ -n "${IFACE_IPV6_ADDR}" ]; then
exit 0
fi
else
exit 0
fi
fi
if [ "${BOARD}" = "native" ] || [ "${BOARD}" = "native64" ]; then
echo "You may be able to create \"${IFACE}\" by using e.g." \
"\`${RIOTTOOLS#${RIOTBASE}/}/tapsetup/tapsetup\`."
echo "You can add a routable IPV6 address by using e.g." \
"sudo ip address add 2001:db8::1/64 dev ${IFACE}"
else
echo "You may setup \"${IFACE}\" by using e.g." \
"\`${RIOTTOOLS#${RIOTBASE}/}/ethos/setup_network.sh ${IFACE} 2001:db8::/64\`"
fi
exit 1