DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: @ T a

⟦4aca32e1a⟧ TextFile

    Length: 1233 (0x4d1)
    Types: TextFile
    Notes: @(#)addgrp.sh 13.1 (RC International) 91/07/25
    Names: »addgrp«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/sadm/sysadm/bin/addgrp« 

TextFile

#	@(#)addgrp.sh	13.1 (RC International) 91/07/25

#	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#!/sbin/sh
#ident	"@(#)oamintf:usermgmt/addgrp.sh	1.3"

################################################################################
#	Command Name: addgrp
#
#	Description: This scripts does 3 things:
#			1) adds group to the system
#		     	2) changes primary group for specified logins
#			3) adds supplementary group status to specified logins.
#
# 	Inputs:		$1 - Group name
# 			$2 - group ID
# 			$3 - primary grou(s)
# 			$4 - supplementary grou(s)
################################################################################

NOADD=1
BADPRIM=2
BADSUP=3

# add group to system
groupadd -g $2 $1 2> /tmp/gadderr || exit $NOADD

# change primary group for specified logins
if [ $3 ]
then
	for x in `echo $3 | sed 's/,/ /g'`
	do
		usermod -g "$1" "$x" > /dev/null 2>> /tmp/gadderr
	done || exit $BADPRIM
fi

# add supplementary group members
if [ $4 ]
then
	addgrpmem -g $1 `echo $4 | sed 's/,/ /g'` > /dev/null 2>&1 || $BADSUP
fi