NetBSD/share/sushi/system/usermgmtconf/script1

43 lines
753 B
Bash
Executable File

#!/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