Skip to content

Commit 08fe31f

Browse files
committed
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
1 parent 0f346ad commit 08fe31f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

network/setup-ip

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
set -ueo pipefail
77

88
add_link_route () {
9-
/sbin/ip -- route replace to unicast "$1" dev "$2" scope link
9+
ip -- route replace to unicast "$1" dev "$2" scope link
1010
}
1111

1212
add_default_route () {
13-
/sbin/ip -- route replace to unicast default via "$1" dev "$2" onlink
13+
ip -- route replace to unicast default via "$1" dev "$2" onlink
1414
}
1515

1616
readonly netvm_mac=fe:ff:ff:ff:ff:ff
@@ -27,19 +27,19 @@ configure_network () {
2727
local secondary_dns="${10}"
2828
local custom="${11}"
2929

30-
/sbin/ip -- address replace "$ip/$netmask" dev "$INTERFACE"
30+
ip -- address replace "$ip/$netmask" dev "$INTERFACE"
3131
if [[ "$custom" = false ]]; then
32-
/sbin/ip -- neighbour replace to "$gateway" dev "$INTERFACE" \
32+
ip -- neighbour replace to "$gateway" dev "$INTERFACE" \
3333
lladdr "$netvm_mac" nud permanent
3434
fi
3535
if [ -n "$ip6" ]; then
36-
/sbin/ip -- address replace "$ip6/$netmask6" dev "$INTERFACE"
36+
ip -- address replace "$ip6/$netmask6" dev "$INTERFACE"
3737
if [ -n "$gateway6" ] && [[ "$custom" = false ]]; then
38-
/sbin/ip -- neighbour replace to "$gateway6" dev "$INTERFACE" \
38+
ip -- neighbour replace to "$gateway6" dev "$INTERFACE" \
3939
lladdr "$netvm_mac" nud permanent
4040
fi
4141
fi
42-
/sbin/ip link set dev "$INTERFACE" group 1 up
42+
ip link set dev "$INTERFACE" group 1 up
4343

4444
if [ -n "$gateway" ]; then
4545
add_link_route "$gateway" "$INTERFACE"
@@ -96,7 +96,7 @@ configure_network_nm () {
9696
local ip4_nm_config
9797
local ip6_nm_config
9898
local uuid
99-
/sbin/ip link set dev "$INTERFACE" group 1
99+
ip link set dev "$INTERFACE" group 1
100100

101101
prefix="$(get_prefix_from_subnet "$netmask")"
102102
prefix6="$netmask6"
@@ -167,12 +167,12 @@ __EOF__
167167
# reload connection
168168
nmcli connection load "$nm_config" || :
169169
if [[ "$custom" = false ]]; then
170-
/sbin/ip -- neighbour replace to "$gateway" dev "$INTERFACE" \
170+
ip -- neighbour replace to "$gateway" dev "$INTERFACE" \
171171
lladdr "$netvm_mac" nud permanent
172172
fi
173173
if [ -n "$gateway6" ]; then
174174
if [[ "$custom" = false ]]; then
175-
/sbin/ip -- neighbour replace to "$gateway6" dev "$INTERFACE" \
175+
ip -- neighbour replace to "$gateway6" dev "$INTERFACE" \
176176
lladdr "$netvm_mac" nud permanent
177177
fi
178178
fi

0 commit comments

Comments
 (0)