Support launching old dagger.

This commit is contained in:
Tom Alexander
2024-06-30 16:18:55 -04:00
parent f09844c03c
commit 0363a462a0
6 changed files with 26 additions and 24 deletions

View File

@@ -2,6 +2,9 @@ cloak {
path = "/jail/${name}";
vnet;
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start restricted_nat jail${name} 10.215.2.1/24";
# Create a dummy interface that is never used, just to create the cloak bridge that is used by children.
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak dummy${name} 192.168.1.0/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop cloak dummy{name}";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop restricted_nat jail${name}";
vnet.interface += "jail${name}";
vnet.interface += "cloak";

View File

@@ -3,6 +3,9 @@ dagger {
vnet;
vnet.interface += "dagger";
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak ${name} 192.168.1.0/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop cloak ${name}";
exec.start += "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown jail";
exec.consolelog = "/var/log/jail_${name}_console.log";

View File

@@ -0,0 +1,12 @@
olddagger {
path = "/jail/${name}";
vnet;
vnet.interface += "olddagger";
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak ${name} 192.168.1.0/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop cloak ${name}";
exec.start += "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown jail";
exec.consolelog = "/var/log/jail_${name}_console.log";
}

View File

@@ -1,23 +0,0 @@
#!/usr/local/bin/bash
cleanup() {
/usr/local/bin/jail_netgraph_bridge stop cloak dagger
}
setup_netgraph_start() {
cleanup
/usr/local/bin/jail_netgraph_bridge start cloak dagger 192.168.1.0/24
}
setup_netgraph_stop() {
cleanup
}
if [ "$1" = "start" ]; then
setup_netgraph_start
elif [ "$1" = "stop" ]; then
setup_netgraph_stop
else
>&2 echo "Unrecognized command"
fi