These are two snippets I've written in BASH in the last few days to allow IMUNES users to export changes made to an experiment in runtime, on Linux.
The former allows users to export changes, the latter allows them to load changes back to Docker containers.
They will be improved day by day, so it's recommended to consult this page to get an updated version of them, especially if you encounter problems.
The execution flow to use these scripts properly is:
- Draw a topology
- Run the experiment
- Make changes you want to make (e.g. configurations, your files, etc.)
- Use the first script to export those changes to your computer's file system
- Stop the experiment
- Save the topology
- Close IMUNES
- Open IMUNES again
- Load the topology back
- Execute the experiment
- Use the second script to load your previously exported changes back
- Your Linux distribution needs to have the zenity package installed
- Both scripts need to be executed with root privileges or by a user that is assigned to the docker group. Remember that if you run them with root privileges, the files created by them will be owned by root, so you could encounter permission problems.
- You can use these scripts passing them as argument to the BASH interpeter.
# bash imunes-export.sh
# bash imunes-import.sh
- You can either assign the executable flag to the scripts with
chmod +x imunes-export.sh ; chmod+x imunes-import.sh
and call them directly writing
in the directory where they are placed.
- Obviously you can put them (with the executable flag assigned) in a directory specified in the PATH environment variable (e.g. /usr/bin) to be able to call them from anywhere.
You can report issues (and suggest corrections of course) using my own comment system or GitHub's one.