I'm working on a shell script that will automatically install additional programs after a fresh install of ubuntu 18.04 and restore my personal data and program data. To restore my program data I need the folder structure that is created by the programs after their first launch. As an example I'll use firefox, but I also need it for for instance thunderbird and some other programs. I know you can also use a firefox account and let it restore your account, but that is not what I need since I also have other programs that do not allow that sort of restoring.
The user profile data of a fesh install of firefox is stored in /home/$USER/.mozilla/firefox/*.default-release
. I need to copy my backup of my profile data into that folder, firefox will then start with my profile data. The problem is that the exact name of the *.default-release
folder is not known in advance. I think it is some kind of random generation, for instance my profile folder is called 11qpplpx.default-release
. So I cannot just use mkdir /home/$USER/11qpplpx.default-release
to create the folder before I start firefox, because the name of the folder is random.
I am now trying to start firefox from the command line and immediately stop it so the folder structure is created, but firefox is closed again so the rest of the shell script can run to copy the files into the directory. My question is, how do I start firefox and immediately stop it again, but still let it create the folder structure? I tried firefox & pkill -f firefox
, which does not create the folder structure.
Thanks in advance!