carbon-config

config submodule of carbon-core-system
git clone https://ccx.te2000.cz/git/carbon-config
Log | Files | Refs

commit 82c987f33daad95f15dad37f7cacb49c7684cf7c
parent 3a82e11fd6411ec6c87de4978dc67cbe719aee84
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Tue, 26 Jul 2022 21:28:25 +0200

quoting for consistency

Diffstat:
Mpostinstall.aat | 10+++++-----
Mpostinstall.fileset | 8++++----
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/postinstall.aat b/postinstall.aat @@ -1,4 +1,4 @@ -|function passwd_user(line) { +|function passwd_user(line, grep1) { /etc/passwd f + !f awk 'BEGIN { FS=OFS=":"; seen=0; line="{{line}}"; split(line, a) } { uids[$3] = $0 } @@ -52,11 +52,11 @@ | grep1 = pre match_str post | gsub(/[][)(\\\/*+?]/, "\\\\&", regex) | gsub(/[][)(\\\/*+?]/, "\\\\&", grep1) -? grep -qEe '^{{grep1}}$' $fname -! if grep -qEe '{{pre_re regex post_re}}' $fname; then - sed -ire 's|{{pre_re regex post_re}}|{{pre match_str post}}|' $fname +? grep -qEe '^{{grep1}}$' "$fname" +! if grep -qEe '{{pre_re regex post_re}}' "$fname"; then + sed -ire 's|{{pre_re regex post_re}}|{{pre match_str post}}|' "$fname" else - printf '%s\n' '{{pre match_str post}}' >> $fname + printf '%s\n' '{{pre match_str post}}' >> "$fname" fi |} |END{ diff --git a/postinstall.fileset b/postinstall.fileset @@ -37,11 +37,11 @@ CN # Managed by /usr/src/core-system /etc + /etc/group + -? grep -qEe '^sshd:x:22:$' $fname -! if grep -qEe '^[^:]*:[^:]*:22:' $fname; then - sed -ire 's|^[^:]*:[^:]*:22:|sshd:x:22:|' $fname +? grep -qEe '^sshd:x:22:$' "$fname" +! if grep -qEe '^[^:]*:[^:]*:22:' "$fname"; then + sed -ire 's|^[^:]*:[^:]*:22:|sshd:x:22:|' "$fname" else - printf '%s\n' 'sshd:x:22:' >> $fname + printf '%s\n' 'sshd:x:22:' >> "$fname" fi /etc/passwd f +