Hello there,
We can write the bash script to achieve all your requirements and make it working properly.
We are a team of server administrators having many years of experience in the field of Linux administration, Cloud Management Services etc.
Kindly accept our proposal and we can have a detailed discussion through chat. Hope to hear from you soon.
Thank you