Directadmin

How to rebuild /etc/virtual/domainowners

Create a script with the following contents by running:

cd /etc/virtual
vi fix_domainowners.sh

Copy the following code:

#!/bin/sh

for u in `ls /usr/local/directadmin/data/users`; do
{
for d in `cat /usr/local/directadmin/data/users/$u/domains.list`; do
{
echo “$d: $u”

for p in `cat /usr/local/directadmin/data/users/$u/domains/$d.pointers | cut -d= -f1 2>/dev/null`; do
{
echo “$p: $u”
}
done;
}
done;
}
done;

Save and Exit.

Once at the prompt, type:

chmod 755 fix_domainowners.sh
./fix_domainowners.sh > domainowners
chmod 644 domainowners
chown mail:mail domainowners