addPasswd()
{
if [ -z "`useradd 2>&1 | grep -- -o`" ]; then
+ # useradd does *not* support the -o option
useradd -c 'Facsimile Agent' -d $4 -s /bin/false $1;
usermod -u $2 -o -g $3 $1;
- elif [ -z "`useradd -M 2>&1 | grep invalid`" ]; then
+ elif [ -z "`useradd -M 2>&1 | grep -E 'invalid|illegal'`" ]; then
+ # useradd supports the -M option
useradd -M -c 'Facsimile Agent' -d $4 -u $2 -o -g $3 -s /bin/false $1;
else
+ # useradd does *not* support the -M option
useradd -c 'Facsimile Agent' -d $4 -u $2 -o -g $3 -s /bin/false $1;
fi
}