WenRou's Blog

新浪微薄腾讯微薄

最新碎语:测试图片碎语哦

您的位置:WenRou's Blog >面板> 重建directadmin user.list用户

重建directadmin user.list用户

Create a fix.sh somewhere and fill it with the following 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;


chmod the fix.sh to 755 and run it.

It can be run repeatedly as the users.list files are emptied before the run starts.

---

转载请注明本文标题和链接:《重建directadmin user.list用户

发表评论

42 + 4 =
路人甲 表情
看不清楚?点图切换 Ctrl+Enter快速提交