Honestly, I'd suggest checking to see if /etc/telegraf/ exists and if it does, check whether the file exists in /etc/telegraf/telegraf.d/retracer.conf, if it doesn't then write it and restart telegraf, if it does just pass. Messing around with relations in bash is no fun. Really we should sit down at some point and try to get this charm rewritten in reactive python and I think you'll have an overall better experience with it.
Honestly, I'd suggest checking to see if /etc/telegraf/ exists and if it does, check whether the file exists in /etc/telegraf/ telegraf. d/retracer. conf, if it doesn't then write it and restart telegraf, if it does just pass. Messing around with relations in bash is no fun. Really we should sit down at some point and try to get this charm rewritten in reactive python and I think you'll have an overall better experience with it.