GCP VM startup script sed: can't read : No such file or directory

Viewed 44

I have a terraform GCP VM instance (Ubuntu 18.04 LTS Minimal) metadata startup script which is defined via inline. The startup script downloads a file config.toml then edits the file config.toml via sed. When I check the startup script logs via

cat /var/log/syslog

sed: can't read : No such file or directory

My startup script for sed:

chmod -R 777 /pd-disk/config.toml
sed -i 's/http:\/\/localhost:8545/http:\/\/bor:8545/g' /pd-disk/config.toml

I know the command works properly if I SSH into the VM and manually execute the sed command:

sed -i 's/http://localhost:8545/http://bor:8545/g' /pd-disk/config.toml

What is the proper method or syntax for sed to execute within the startup script?

0 Answers
Related