Rebuild your DirectAdmin user cache

In some particular cases I was unable to find my users using the DirectAdmin UI. Since then I use this little script to rebuild the user cache of the “Show All Users” list.

[code]#!/bin/sh

cd /usr/local/directadmin/data/users

for r in `ls */reseller.conf | cut -d/ -f1`; do
{
echo “fixing Reseller $r …”;

echo -n ” > $r/users.list

for u in `grep “^creator=$r$” */user.conf | cut -d/ -f1`; do
{
ISUSER=`grep -c usertype=user $u/user.conf`
if [ “$ISUSER” = “1” ]; then
echo $u >> $r/users.list
fi
};
done;
};
done;[/code]

After using this script all users will be shown again in DirectAdmin.

Author: Maarten Keizer

Hosting guru. WordPress addict. n00b programmer.

Leave a Reply

Your email address will not be published. Required fields are marked *