Add new menu to sushi to deal with editing the /etc/usermgmt.conf file.

This commit is contained in:
garbled 2001-03-06 21:26:27 +00:00
parent 2544d3c650
commit 4d827fcbd3
5 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/03/06 21:26:27 garbled Exp $
FILES= form help
FILESDIR=${BINDIR}/sushi/system/usermgmtconf
SCRIPTS= script script1
SCRIPTSDIR=${BINDIR}/sushi/system/usermgmtconf
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,10 @@
# $NetBSD: form,v 1.1 2001/03/06 21:26:27 garbled Exp $
script:script1,group Default group to assign users to
escript:20,script1,base_dir Pathname to base of user's home directories
escript:20,script1,skel_dir Pathname to location of skeleton files
script:script1,shell Default shell for users
iscript:4,1,1000,script1,inactive Days of inactivity before user's account is locked
escript:11,script1,expire Time in seconds when account will expire
script:script1,preserve User login data to be preserved on delete
escript:13,script1,password Encrypted password to assign new users
escript:15,script1,range UID range to assign new users from

View File

@ -0,0 +1,11 @@
More information on the various fields can be found in the following
manpages:
useradd(8), userdel(8), userinfo(8), usermod(8), user(8)
The range field is a range of UID's in the form:
100..500
Where the '..' is the separator field.
Inactivity time is set in days, and automatically translated into seconds.
$NetBSD: help,v 1.1 2001/03/06 21:26:27 garbled Exp $

View File

@ -0,0 +1,22 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/03/06 21:26:27 garbled Exp $
cp /dev/null /etc/usermgmt.conf
j=0
BIGLIST="group base_dir skel_dir shell inactive expire preserve password range"
for i in $BIGLIST
do
j=`expr $j + 1`
x=$(echo `eval echo \\$${j}` | sed -e 's/^ *//')
if [ "$x" = "" ]; then
continue
fi
n=`echo $i | wc -m`
if [ $n -gt 7 ]; then
echo "$i $x" >>/etc/usermgmt.conf
else
echo "$i $x" >>/etc/usermgmt.conf
fi
done
chown root:wheel /etc/usermgmt.conf
chmod 644 /etc/usermgmt.conf

View File

@ -0,0 +1,42 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/03/06 21:26:27 garbled Exp $
if [ "$1" = "inactive" ]; then
DATA=`grep $1 /etc/usermgmt.conf | sed -e "s@$1 *@@"`
if [ "$?" = "0" ]; then
expr $DATA / 86400
else
echo "0"
fi
exit 0
fi
DATA=`grep $1 /etc/usermgmt.conf | sed -e "s@$1 *@@"`
if [ "$?" = "0" ]; then
echo "$DATA"
else
if [ "$1" = "preserve" ]; then
echo "false"
echo "true"
exit 0
fi
if [ "$1" = "expire" ]; then
echo "Null (unset)"
else
echo " "
fi
fi
if [ "$1" = "shell" ]; then
cat /etc/shells | grep -v $DATA | grep -v '^$' | grep -v '^#'
fi
if [ "$1" = "group" ]; then
cut -f1 -d : /etc/group | grep -v $DATA
fi
if [ "$1" = "preserve" ]; then
if [ "$DATA" = "true" ]; then
echo "false"
else
echo "true"
fi
fi