CS3700-project2/scripts/nspawn-support.sh

14 lines
572 B
Bash
Raw Normal View History

2020-01-29 21:23:07 +00:00
#!/bin/bash
cmd="$1"
dir="$2"
if [ "$cmd" == "create" ]; then
2020-01-30 23:29:08 +00:00
debootstrap --include=systemd-container --include=racket --components=main,universe disco "$dir" http://archive.ubuntu.com/ubuntu/
systemd-nspawn -D "$dir" --bind "$PWD:/router" -- /bin/bash -c "cd /router && scripts/setup.sh"
2020-01-29 21:23:07 +00:00
elif [ "$cmd" == "boot" ]; then
systemd-nspawn -D "$dir" --bind "$PWD:/router" -- /bin/bash -c "cd /router && scripts/run-tests.sh /router/build"
2020-01-30 23:29:08 +00:00
elif [ "$cmd" == "test" ]; then
systemd-nspawn -D "$dir" --bind "$PWD:/router" -- /bin/bash -c "cd /router && bash"
2020-01-29 21:23:07 +00:00
fi