File: post_setup_dummy_users

package info (click to toggle)
piuparts 1.6.0
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 72,532 kB
  • sloc: python: 8,240; sh: 4,367; makefile: 171
file content (22 lines) | stat: -rwxr-xr-x 446 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -e

sys_ids=$(seq 100 149)
usr_ids=$(seq 1000 1010)

case ${PIUPARTS_OBJECTS%%=*} in
	TARBALL)
		# skip while creating the tarball
		exit 0
		;;
	dpsyco*)
		# may kill processes of these users on the host if they exist in the chroot
		usr_ids=
		;;
esac

for id in $sys_ids $usr_ids
do
	getent group $id > /dev/null || groupadd --system -g $id dummy$id
	getent passwd $id > /dev/null || useradd --system -u $id -g 100 dummy$id
done