Pre and Post Domain Modification Scripts where to save them?

I discovered “Pre and Post Domain Modification Scripts” and it may very well suit my needs. But where would I save the scripts? Is there a defined location?


I was not very inventive … on my RedHat boxes I used


I too wondered if there was a more standardized place in the VirtualMin environment …


I wouldn’t put them anywhere they might accidentally be run by a user (or worse root). So, if /usr/local/bin is in your path (it probably is), I wouldn’t consider it a good choice. But, there are no rules.

/usr/libexec/virtualmin-scripts or /usr/share/virtualmin-scripts or their /usr/local equivalent might make sense.

Edit: The reason I suggest not putting them in the path is that they expect environment variables to be set that won’t be set by someone just running them, and depending on what you put in them it might cause something disastrous. e.g. say, you have it configured to delete some extra bin directory you create for your users and their home gets passed in…and then you call it accidentally with the home not available, and it runs rm -rf /bin. This is a very contrived silly example, but worse and sillier things have happened (not to me, no, I would never make silly mistakes and delete important files or break DNS or whatever).

so a script that is a part of this Nginx on webmin in front of virtualmin apache vhosts should not be in /usr/local/bin/ but in a to create /anyother/therearenorules/folder/. Is that correct?

It’s up to you. I don’t know what you’re putting in your scripts. Maybe they aren’t potentially dangerous. Maybe they check to be sure they’re being run by Virtualmin with appropriate options and are usable in other contexts. There may be cases where you want them in the path. But, I’d err on the side of caution.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.