Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: DirectAdmin: How to rebuild empty /etc/virtual/domainowners file  (Read 13667 times)

0 Members and 1 Guest are viewing this topic.

vinayakk

  • Guest
Create a script with the following contents by running:

cd /etc/virtual
vim fix_domainowners.sh


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


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

 :)