Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-11-15 19:37:10 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-11-15 19:37:10 -0300
commitcbfa68ccaba72a22b56fbac6cf8cd9e6e2781888 (patch)
tree9b868dff4f5b05fb76c5dbc8257a6600b7d51d7a /archiso
parenta53e05accd352d88c2b23484fe3b3389d663d1b5 (diff)
[hooks/archiso_pxe_nbd] Remove grep usage
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'archiso')
-rw-r--r--archiso/hooks/archiso_pxe_nbd13
1 files changed, 9 insertions, 4 deletions
diff --git a/archiso/hooks/archiso_pxe_nbd b/archiso/hooks/archiso_pxe_nbd
index cc21c2b..cdf4392 100644
--- a/archiso/hooks/archiso_pxe_nbd
+++ b/archiso/hooks/archiso_pxe_nbd
@@ -1,6 +1,6 @@
# vim: set ft=sh:
run_hook () {
- local line i address netmask gateway dns0 dns1 rootserver rootpath filename
+ local line i net_mac bootif_mac bootif_dev address netmask gateway dns0 dns1 rootserver rootpath filename
: > /ip_opts
@@ -8,9 +8,14 @@ run_hook () {
if [ -n "${BOOTIF}" ]; then
bootif_mac=${BOOTIF#01-}
bootif_mac=${bootif_mac//-/:}
- bootif_dev=$(grep -l ${bootif_mac} /sys/class/net/*/address)
- bootif_dev=${bootif_dev#/sys/class/net/}
- bootif_dev=${bootif_dev%/address}
+ for i in /sys/class/net/*/address; do
+ read net_mac < ${i}
+ if [ "${bootif_mac}" == "${net_mac}" ]; then
+ bootif_dev=${i#/sys/class/net/}
+ bootif_dev=${bootif_dev%/address}
+ break
+ fi
+ done
ip="${ip}::${bootif_dev}"
fi