Prepend reseller's username to package names

sparek

Verified User
Joined
Jun 27, 2019
Messages
484
Wondering if there is a way to automatically prepend the reseller's username to any package that they might create.

I've tried doing this through a package_write_pre.sh hook, but apparently the variables (name and package_filename) are already passed to the system before package_write_pre.sh is triggered, so you can't manipulate the variables there.

I then tried doing this though a package_write_post.sh hook, to move things around after the package has been written, but either the file /usr/local/directadmin/data/users/%reseller%/packages.list is not writable at this stage or it gets overwritten after package_write_post.sh is triggered.

Just wondering if there is something I might be missing.
 
Hello,

Actually the hook is running under superuser privileges, i.e. "root". So it should not be the reason.
It seems the actual packages.list file gets overwritten as soon as package_write_post.sh completes. You might try and use at tool or crontab for updating the file afterwards.
 
Back
Top