index : mkinitcpio-archiso32 | |
Archlinux32 initcpio scripts used by archiso | gitolite user |
summaryrefslogtreecommitdiff |
author | David Runge <dvzrv@archlinux.org> | 2021-07-31 16:32:48 +0200 |
---|---|---|
committer | David Runge <dvzrv@archlinux.org> | 2021-07-31 17:32:40 +0200 |
commit | 37529a96766a5841fc6561acfbfbf42b3d6ff98a (patch) | |
tree | 14538b925812f0d6a30672c21e8952609ff28619 /hooks/archiso_pxe_common | |
parent | a5f57c2bfa3f7b380f572b4e86845113d6b9ef15 (diff) |
-rw-r--r-- | hooks/archiso_pxe_common | 20 |
diff --git a/hooks/archiso_pxe_common b/hooks/archiso_pxe_common index 00507cb..6cadc34 100644 --- a/hooks/archiso_pxe_common +++ b/hooks/archiso_pxe_common @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -run_hook () { +run_hook() { # Do *not* declare 'bootif_dev' local! We need it in run_latehook(). local i net_mac bootif_mac local DNSDOMAIN HOSTNAME IPV4DNS0 IPV4DNS1 ROOTSERVER @@ -17,7 +17,7 @@ run_hook () { # ash supports bash-like string replacment bootif_mac="${bootif_mac//-/:}" for i in /sys/class/net/*/address; do - read -r net_mac < "${i}" + read -r net_mac <"${i}" if [ "${bootif_mac}" = "${net_mac}" ]; then bootif_dev=${i#/sys/class/net/} bootif_dev=${bootif_dev%/address} @@ -47,20 +47,20 @@ run_hook () { # setup DNS resolver if [ "${IPV4DNS0}" != "0.0.0.0" ]; then - echo "# added by archiso_pxe_common hook" > /etc/resolv.conf - echo "nameserver ${IPV4DNS0}" >> /etc/resolv.conf + echo "# added by archiso_pxe_common hook" >/etc/resolv.conf + echo "nameserver ${IPV4DNS0}" >>/etc/resolv.conf fi if [ "${IPV4DNS1}" != "0.0.0.0" ]; then - echo "nameserver ${IPV4DNS1}" >> /etc/resolv.conf + echo "nameserver ${IPV4DNS1}" >>/etc/resolv.conf fi if [ -n "${DNSDOMAIN}" ]; then - echo "search ${DNSDOMAIN}" >> /etc/resolv.conf - echo "domain ${DNSDOMAIN}" >> /etc/resolv.conf + echo "search ${DNSDOMAIN}" >>/etc/resolv.conf + echo "domain ${DNSDOMAIN}" >>/etc/resolv.conf fi fi } -run_latehook () { +run_latehook() { if [ -n "${ip}" ]; then [ -z "${copy_resolvconf}" ] && copy_resolvconf="y" @@ -73,8 +73,8 @@ run_latehook () { ip link set "${netdev}" down done elif [ "${copy_resolvconf}" != "n" ] && [ -f /etc/resolv.conf ]; then - rm -f /new_root/etc/resolv.conf - cp /etc/resolv.conf /new_root/etc/resolv.conf + rm -f -- /new_root/etc/resolv.conf + cp -- /etc/resolv.conf /new_root/etc/resolv.conf fi fi } |