1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-forgejo synced 2024-09-19 18:06:17 +00:00
setup-forgejo/lxc.sh

24 lines
552 B
Bash
Raw Normal View History

2023-03-25 15:06:50 +00:00
#!/bin/bash
set -x
setup() {
if ! systemctl is-active --quiet lxc-net; then
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make git libvirt0 libpam-cgfs bridge-utils uidmap dnsmasq-base dnsmasq dnsmasq-utils qemu-user-static
systemctl disable --now dnsmasq
apt-get install -y -qq lxc
systemctl stop lxc-net
cat >> /etc/default/lxc-net <<'EOF'
LXC_ADDR="10.0.7.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.7.0/24"
LXC_DHCP_RANGE="10.0.7.2,10.0.7.254"
LXC_DHCP_MAX="253"
EOF
systemctl start lxc-net
fi
}
setup