systemd/sysusers.prov
Zbigniew Jędrzejewski-Szmek ced9237a14 Add the sysusers compat parts
2020-02-10 17:19:18 +01:00

29 lines
601 B
Bash
Executable File

#!/bin/bash
parse() {
while read line; do
[ "${line:0:1}" = '#' -o "${line:0:1}" = ';' ] && continue
line="${line## *}"
[ -z "$line" ] && continue
set -- $line
case "$1" in
('u')
echo "user($2)"
echo "group($2)"
# TODO: user:group support
;;
('g')
echo "group($2)"
;;
('m')
echo "user($2)"
echo "group($3)"
;;
esac
done
}
while read fn; do
parse < "$fn"
done