sysusers.generate-pre.sh: fix indentation in generated scripts

We need to use a mix of spaces and tabs: the tabs are removed because of -EOF,
and then the spaces indent the output. Jesus.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2023-04-26 09:55:55 +02:00
parent 1fa99260fc
commit ef79df9490

View File

@ -20,16 +20,16 @@ user() {
if [ "$uid" = '-' ] || [ "$uid" = '' ]; then
cat <<-EOF
getent passwd '$user' >/dev/null || \\
useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
EOF
else
cat <<-EOF
if ! getent passwd '$user' >/dev/null; then
if ! getent passwd '$uid' >/dev/null; then
useradd -r -u '$uid' -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
else
useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
fi
if ! getent passwd '$uid' >/dev/null; then
useradd -r -u '$uid' -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
else
useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
fi
fi
EOF
@ -57,7 +57,7 @@ usermod() {
cat <<-EOF
if getent group '$group' >/dev/null; then
usermod -a -G '$group' '$user' || :
usermod -a -G '$group' '$user' || :
fi
EOF
}