Revision 9317e5dc
b/Makefile.am | ||
---|---|---|
1384 | 1384 |
tools/users-setup: Makefile $(userspecs) |
1385 | 1385 |
set -e; \ |
1386 | 1386 |
{ echo '#!/bin/sh'; \ |
1387 |
echo 'if [ "x$$1" != "x--yes-do-it" ];'; \ |
|
1388 |
echo 'then echo "This will do the following changes"'; \ |
|
1389 |
$(AWK) -- '{print "echo + Will add group ",$$1; count++}\ |
|
1390 |
END {if (count == 0) {print "echo + No groups to add"}}' doc/users/groups; \ |
|
1391 |
$(AWK) -- '{if (NF > 1) {print "echo + Will add user",$$1,"with primary group",$$2} \ |
|
1392 |
else {print "echo + Will add user",$$1}; count++}\ |
|
1393 |
END {if (count == 0) {print "echo + No users to add"}}' doc/users/users; \ |
|
1394 |
$(AWK) -- '{print "echo + Will add user",$$1,"to group",$$2}' doc/users/groupmemberships; \ |
|
1395 |
echo 'echo'; \ |
|
1396 |
echo 'echo "OK? (y/n)"'; \ |
|
1397 |
echo 'read confirm'; \ |
|
1398 |
echo 'if [ "x$$confirm" != "xy" ]; then exit 0; fi'; \ |
|
1399 |
echo 'fi'; \ |
|
1387 | 1400 |
$(AWK) -- '{print "addgroup --system",$$1}' doc/users/groups; \ |
1388 | 1401 |
$(AWK) -- '{if (NF > 1) {print "adduser --system --ingroup",$$2,$$1} else {print "adduser --system",$$1}}' doc/users/users; \ |
1389 | 1402 |
$(AWK) -- '{print "adduser",$$1,$$2}' doc/users/groupmemberships; \ |
Also available in: Unified diff