From 08fe31f58d88e858a8c0a3f220f2934b7cc7d949 Mon Sep 17 00:00:00 2001 From: Simon Gaiser Date: Thu, 25 Jul 2024 22:19:04 +0200 Subject: [PATCH] setup-ip: Invoke 'ip' via $PATH Debian recently [1] removed the symlink in /sbin which breaks our setup-ip script. Fedora on the other hand has 'ip' only in {/usr,}/sbin. So invoke ip without specifying a path and rely on the shell's $PATH. [1]: https://salsa.debian.org/kernel-team/iproute2/-/commit/c4bb148dd4ed0601ca32ee8a458007d0c348d6c3 --- network/setup-ip | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/network/setup-ip b/network/setup-ip index 9126f902..11144a50 100755 --- a/network/setup-ip +++ b/network/setup-ip @@ -6,11 +6,11 @@ set -ueo pipefail add_link_route () { - /sbin/ip -- route replace to unicast "$1" dev "$2" scope link + ip -- route replace to unicast "$1" dev "$2" scope link } add_default_route () { - /sbin/ip -- route replace to unicast default via "$1" dev "$2" onlink + ip -- route replace to unicast default via "$1" dev "$2" onlink } readonly netvm_mac=fe:ff:ff:ff:ff:ff @@ -27,19 +27,19 @@ configure_network () { local secondary_dns="${10}" local custom="${11}" - /sbin/ip -- address replace "$ip/$netmask" dev "$INTERFACE" + ip -- address replace "$ip/$netmask" dev "$INTERFACE" if [[ "$custom" = false ]]; then - /sbin/ip -- neighbour replace to "$gateway" dev "$INTERFACE" \ + ip -- neighbour replace to "$gateway" dev "$INTERFACE" \ lladdr "$netvm_mac" nud permanent fi if [ -n "$ip6" ]; then - /sbin/ip -- address replace "$ip6/$netmask6" dev "$INTERFACE" + ip -- address replace "$ip6/$netmask6" dev "$INTERFACE" if [ -n "$gateway6" ] && [[ "$custom" = false ]]; then - /sbin/ip -- neighbour replace to "$gateway6" dev "$INTERFACE" \ + ip -- neighbour replace to "$gateway6" dev "$INTERFACE" \ lladdr "$netvm_mac" nud permanent fi fi - /sbin/ip link set dev "$INTERFACE" group 1 up + ip link set dev "$INTERFACE" group 1 up if [ -n "$gateway" ]; then add_link_route "$gateway" "$INTERFACE" @@ -96,7 +96,7 @@ configure_network_nm () { local ip4_nm_config local ip6_nm_config local uuid - /sbin/ip link set dev "$INTERFACE" group 1 + ip link set dev "$INTERFACE" group 1 prefix="$(get_prefix_from_subnet "$netmask")" prefix6="$netmask6" @@ -167,12 +167,12 @@ __EOF__ # reload connection nmcli connection load "$nm_config" || : if [[ "$custom" = false ]]; then - /sbin/ip -- neighbour replace to "$gateway" dev "$INTERFACE" \ + ip -- neighbour replace to "$gateway" dev "$INTERFACE" \ lladdr "$netvm_mac" nud permanent fi if [ -n "$gateway6" ]; then if [[ "$custom" = false ]]; then - /sbin/ip -- neighbour replace to "$gateway6" dev "$INTERFACE" \ + ip -- neighbour replace to "$gateway6" dev "$INTERFACE" \ lladdr "$netvm_mac" nud permanent fi fi