commands/allvpasswd2cdb
author "Tomas Zeman <tzeman@volny.cz>"
Wed, 16 Jan 2008 22:39:43 +0100
changeset 0 6f7a81934006
permissions -rwxr-xr-x
Imported vmailmgr-0.96.9

#!/bin/sh
while IFS=: read name pass uid gid gecos home shell; do
  echo -n "$name($uid): "
  if ! cd "$home" 2>/dev/null; then
    echo Skipping, has invalid home directory.
    continue
  fi
  if [ -f passwd -a -d users ] && \
     fgrep vdeliver .qmail-default >/dev/null 2>&1; then
    if [ -f passwd.cdb ]; then
      echo Skipping, has already been converted.
    else
      su - $name sh -c 'exec vpasswd2cdb'
      echo Converted.
    fi
  else
    echo Skipping, is missing a passwd file.
  fi
done </etc/passwd