Creating default packages for new Resellers using the user_create_post.sh script

If you want to give new Resellers a base set of packages to start off with, you can create the script: /usr/local/directadmin/scripts/custom/user_create_post.sh

and inside it, add the code:

#!/bin/sh
BASE=admin
if [ "$usertype" = "reseller" ]; then
    DIR=/usr/local/directadmin/data/users
    cp -fp $DIR/$BASE/packages.list $DIR/$username/packages.list
    cp -fp $DIR/$BASE/packages/* $DIR/$username/packages
fi
exit 0;

Where you can change the admin value to something else if you want to copy the default packages from some other Reseller on your system. The above script will copy all User packages from the BASE account to all newly created Reseller accounts. Remember to chmod the user_create_post.sh script to 755 so it's executable.

 
config/default_packages.txt · Last modified: 2010/02/22 03:18 by muscardin
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki