This script creates an isolated environment using Linux namespaces and cgroups, executes a provided Bash script, and then cleans up the environment. It ensures that any changes made within the isolated environment do not affect the host system.
- Argument Check: The script checks if a Bash script file is provided as an argument.
- File Existence Check: It verifies if the provided file exists.
- Cgroup Creation: A cgroup is created to limit the number of processes to 50.
- Namespace Creation: The script creates new PID and UTS namespaces using
unshare
.