On Fri, Jan 22, 2021 at 09:30:04AM +0800, Luan Shengde wrote:
{ echo "${config_rootfs}" | grep -qw 'dns' || return 0
- grep "^dns=none" $config_file || sed -i '/^[main]/adns=none' "${ROOTFS_DES_DIR}/etc/NetworkManager/NetworkManager.conf"
keep silence for grep, and too long line.
good.
=> grep -s "^dns=none" $config_file || { sed -i '/^[main]/adns=none' "${ROOTFS_DES_DIR}/etc/NetworkManager/NetworkManager.conf" }
Btw, we may use '-qs', not only -s. :)
-q, --quiet, --silent suppress all normal output -s, --no-messages suppress error messages
-------- Thanks Yu Chuan
Thanks Luan Shengde
- cat <<-EOF > "${ROOTFS_DES_DIR}/etc/resolv.conf" nameserver 114.114.114.114 nameserver 8.8.8.8
-- 2.23.0