From 37529a96766a5841fc6561acfbfbf42b3d6ff98a Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 31 Jul 2021 16:32:48 +0200 Subject: Fix formatting with shfmt {hooks,install,script}/*: Fix formatting in all scripts using shfmt. Replace a few echo calls with printf. --- hooks/archiso_pxe_common | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'hooks/archiso_pxe_common') 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 } -- cgit v1.2.3-70-g09d2