forked from pool/sysuser-tools
45d70a85d7
- An "u" in a sysusers.d file will create an user and a group. Create provides for both, user and group. OBS-URL: https://build.opensuse.org/request/show/863987 OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=35
22 lines
313 B
Bash
22 lines
313 B
Bash
#!/bin/bash
|
|
|
|
parse()
|
|
{
|
|
while read line; do
|
|
[ "${line:0:1}" != '#' ] || continue
|
|
line="${line## *}"
|
|
[ -n "$line" ] || continue
|
|
set -- $line
|
|
if [ "$1" = 'g' ]; then
|
|
echo "group($2)"
|
|
elif [ "$1" = 'u' ]; then
|
|
echo "user($2)"
|
|
echo "group($2)"
|
|
fi
|
|
done
|
|
}
|
|
|
|
while read fn; do
|
|
parse < "$fn"
|
|
done
|