6
0
forked from pool/sysuser-tools

Accepting request 457437 from home:kukuk:sysusers

Initial tool package for the new system user proposal

OBS-URL: https://build.opensuse.org/request/show/457437
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=1
This commit is contained in:
Ludwig Nussel
2017-02-16 15:08:58 +00:00
committed by Git OBS Bridge
commit 20ab9219b9
8 changed files with 152 additions and 0 deletions

24
sysusers-generate-pre Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
# pass systemd sysusers config files a as argument to this script.
# It will output a shell script that creates those users by
# appending the data to itself.
tmpfile=`mktemp -q -t sysusers.XXXXXX`
cleanup()
{
rm -f "$tmpfile"
}
trap cleanup EXIT
for i in "$@"; do
grep -e '^[ug]' "$i" >> "$tmpfile"
done
lines=`wc -l < "$tmpfile"`
echo '#!/bin/bash'
echo "tail -n $lines \$0 | /usr/bin/systemd-sysusers - || :"
echo "exit 0"
echo '######## data below ########'
cat "$tmpfile"