Long time listener (and a massive fan, this platform has me gotten out of predicaments more times that I can count), first time writer:
I am looking after a project where we run several Raspbian installs (Jesse Lite) that run chromium via an server in fullscreen - the whole boot process is automated - and the two tabs that get opened come from the /.config/chromium/default/preferences file;
In the relevant section, it says:
{"restore_on_startup":4,"startup_urls":["http://www.example.com/","https://www.example.org"]}
Since these units are essentially headless and I want to (Apple)Script my way to changing these URLs remotely, I looked into calling sed via ssh with public key on the raspberry pi 400s, and I have made good progress around the ssh and public key situation, but I am still not finding it easy to get my head around patterns and (double) escaping this query...
Purely on MacOS first, before getting into the ssh side of things, this is what I have come up with thus far:
sed -i .new 's/"startup_urls":[".*"]}/"startup_urls":["http://www.example.net","http://www.example.com"]}/g' ~/Library/Application\ Support/Google/Chrome/Default/Secure\ Preferences
However, that just gives me:
sed: 1: "s/"startup_urls":[".*"] ...": bad flag in substitute command: '/'
Any help and/or pointers greatly appreciated, otherwise - carry on!
Cheers,
Fred