-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1090 from hellodword/patch-1
fix: prefer using iproute2 instead of ifconfig
- Loading branch information
Showing
5 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
# Dummy "ip addr show" and "ip link show up" emulator | ||
|
||
for arg in "$@"; do | ||
case "$arg" in | ||
link) | ||
cat <<EOF | ||
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 | ||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | ||
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default | ||
link/ether 33:33:33:33:33:33 brd ff:ff:ff:ff:ff:ff link-netnsid 0 | ||
EOF | ||
exit 0 | ||
;; | ||
addr) | ||
cat <<EOF | ||
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 | ||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | ||
inet 127.0.0.1/8 scope host lo | ||
valid_lft forever preferred_lft forever | ||
inet6 ::1/128 scope host | ||
valid_lft forever preferred_lft forever | ||
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default | ||
link/ether 33:33:33:33:33:33 brd ff:ff:ff:ff:ff:ff link-netnsid 0 | ||
inet 192.168.80.11/24 brd 192.168.80.255 scope global eth0 | ||
valid_lft forever preferred_lft forever | ||
inet6 fe80::000:0000:0000:0000/64 scope link | ||
valid_lft forever preferred_lft forever | ||
EOF | ||
exit 0 | ||
;; | ||
esac | ||
done | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters