Initially I thought HA has no access to System path above homeassistant directory, so I put a script in HA installation directory and created a subfolder shell_scripts there.
From terminal it works like a charm, but Automation does execute script.
Script is executable with rwxr-xr-x (0755).
Does it execute via the services tab in the interface?
It also may need to have shell_scripts whitelisted, or put it inside the www directory (which is inside the same directory as configuration.yaml is in)
I tried even without ‘bash’, - no luck.
I think there should not be a problem with name resolution, because I explicitly point SERVER in script like this: