diff options
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/unschroot.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/unschroot.py b/examples/unschroot.py index 5f6ad72..cbabcc4 100755 --- a/examples/unschroot.py +++ b/examples/unschroot.py @@ -167,6 +167,15 @@ def do_begin_session(args: argparse.Namespace) -> None: for tmem in tarf: if not tmem.name.startswith(("dev/", "./dev/")): tarf.extract(tmem, numeric_owner=True) + etc_hosts = pathlib.Path("./etc/hosts") + if not etc_hosts.exists(): + etc_hosts.write_text( + """127.0.0.1 localhost +127.0.1.1 %s +::1 localhost ip6-localhost ip6-loopback +""" + % socket.gethostname(), + ) sys.exit(0) childsock.close() mainsock.recv(1) |