Add 'legacy/scripts/lxc.sh'

pull/4/head
drunkendog 2023-06-23 03:30:42 +01:00
parent dc72b468cd
commit b38904df4f
1 changed files with 8 additions and 0 deletions

8
legacy/scripts/lxc.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
set -e
# TODO: make it take arguments instead of environment variables
lxc launch ubuntu:18.04 $instance_name -c security.nesting=$nesting
lxc config device add $instance_name auto$instance_name proxy listen=$proto:$listen_ip:$external_port connect=$proto:127.0.0.1:$internal_port
sleep $wait | true # wait for network, TODO: more elegant solution
lxc exec $instance_name -- bash -c "$script"