Fix indentation in %sysusers_create_compat macro (rhbz#2132835)
Automatic unindentation after <<-EOF only works with tabs. Jesus.
This commit is contained in:
parent
b2ad8fb38b
commit
3c5b26ff79
@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: true; tab-width: 4; -*-
|
||||
|
||||
# This script turns sysuser.d files into scriptlets mandated by Fedora
|
||||
# packaging guidelines. The general idea is to define users using the
|
||||
@ -17,21 +18,21 @@ user() {
|
||||
{ [ "$shell" = '-' ] || [ "$shell" = '' ]; } && shell=/usr/sbin/nologin
|
||||
|
||||
if [ "$uid" = '-' ] || [ "$uid" = '' ]; then
|
||||
cat <<EOF
|
||||
getent passwd '$user' >/dev/null || \\
|
||||
cat <<-EOF
|
||||
getent passwd '$user' >/dev/null || \\
|
||||
useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
|
||||
EOF
|
||||
EOF
|
||||
else
|
||||
cat <<EOF
|
||||
if ! getent passwd '$user' >/dev/null; then
|
||||
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
|
||||
fi
|
||||
fi
|
||||
|
||||
EOF
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
@ -55,9 +56,9 @@ usermod() {
|
||||
group="$2"
|
||||
|
||||
cat <<-EOF
|
||||
if getent group '$group' >/dev/null; then
|
||||
if getent group '$group' >/dev/null; then
|
||||
usermod -a -G '$group' '$user' || :
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user