summaryrefslogtreecommitdiff
path: root/emulators/suse121_base/files/linux-mkpwd.sh
blob: e24ea03911597bd067beeb12514d86a7f6cc9bcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
# $NetBSD: linux-mkpwd.sh,v 1.1.1.1 2012/03/21 13:35:50 obache Exp $
#

######################################################################
#
# NAME
#	@LINUX_BASE@-mkpwd -- create passwd/group files for COMPAT_LINUX
#
# SYNOPSYS
#	@LINUX_BASE@-mkpwd
#
# DESCRIPTION
#	@LINUX_BASE@-mkpwd creates passwd and group files and databases
#	for a COMPAT_LINUX installation based on the files found in
#	/etc, e.g. /etc/passwd, /etc/master.passwd, /etc/group, etc.
#
######################################################################

SRCDIR=/etc
DESTDIR=@EMULDIR@/etc

[ -d $DESTDIR ] || exit 1

umask 22
cd $DESTDIR
cp -f $SRCDIR/passwd .
sed s/^wheel:/root:/ <$SRCDIR/group >group

umask 77
awk -F: '{print($1":"$2":0:0:10000::::")}' <$SRCDIR/master.passwd >shadow
sed s/^wheel:/root:/ <$SRCDIR/group |
awk -F: '{print($1":*:root:root")}' >gshadow

exit 0