Why don't you write your custom configuration somewhere in /etc? It does not seem right to modify files under /opt, which is supposed to be untouched outside installation and update operations.
As with any dom0 customizations, anyone using this script, make sure you remember that it is there, understand what it does, and be ready to debug it if doesn't work or breaks something. I don't really like it to see automated override of a configuration file by a cron job. What if we need to fix something really important in it, such as a security issue? Or it causes an issue that you don't immediately recognize as a consequence of the script, but then ask our support team to troubleshoot it?
A proper fix would be making XAPI include custom configuration from users, as I suggested to the XAPI project. You can share your use cases in the bug report, by the way: https://github.com/xapi-project/xen-api/issues/4935. Especially if they're in production setups.
stormi created this issue in xapi-project/xen-api open Packaging: xapi-core RPM updates overwrite custom user config in usb-policy.conf #4935