Custom scripts, triggered for actions on packages.. Env vars will be the contents of the package file, plus: name=packagename package_level=reseller|admin package_filename=/usr/local/directadmin/data/admin/packages/NAME.pkg OR /usr/local/directadmin/data/users/RESELLER/packages/NAME.pkg A non-zero exit code will abort the save if it's a "pre" script. The exit code of post scripts do not affect the result. Any output is added to the result. ================= SCRIPT LOCATION For a given script name, eg: package_write_pre.sh You can place it either in: /usr/local/directadmin/scripts/custom/package_write_pre.sh or the new recommended directory method: /usr/local/directadmin/scripts/custom/package_write_pre/your_custom_name.sh ================= SET PACKAGE create or save a package: package_write_pre.sh package_write_post.sh Called anytime the save button is clicked and all package variables are passed. This does also include one of the rename cases, see below. ================= DELETE PACKAGE package_delete_pre.sh package_delete_post.sh The delete scripts will not contain the contents of the packge in the env, but can be read in pre via $package_filename, ahead of the removal. ================= RENAME PACKAGE package_rename_pre.sh package_rename_post.sh The rename scripts will also include new_name=NEWPACKAGENAME but will not contain the contents of the package file. Note that this can be triggered via 2 different ways. 1) action=rename, which only renames the file. Just the above 2 rename files are triggered. 2) add=* method during creation/saving where rename=yes && old_package=OLDNAME are passed, it calls the above package rename scripts, but also the write and delete scripts. ================= COPY PACKAGE package_copy_pre.sh package_copy_post.sh The copy scripts will also include new_name=NEWPACKAGENAME but will not contain the contents of the package file.