mirror of
https://github.com/ebrandi/FDD-book.git
synced 2026-12-06 00:23:30 +00:00
Organize companion code and materials by book part: part-01/ Foundations part-02/ Kernel & driver fundamentals part-03/ Character & block devices part-04/ Networking & storage part-05/ Buses & advanced topics part-06/ Debugging & performance part-07/ Real-world drivers appendices/ Supplementary material README.md Overview and build instructions
26 lines
530 B
Bash
Executable file
26 lines
530 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# teardown.sh - Clean up the VNET jail set up by setup.sh.
|
|
# Chapter 30, Lab 4.
|
|
|
|
set -eu
|
|
|
|
JAIL_NAME="vnet-test"
|
|
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "$0: must be run as root" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if jls | awk '{ print $3 }' | grep -q "^${JAIL_NAME}$"; then
|
|
jail -r "${JAIL_NAME}"
|
|
echo "jail ${JAIL_NAME} removed"
|
|
else
|
|
echo "no jail named ${JAIL_NAME}"
|
|
fi
|
|
|
|
# Remove the epair (will succeed whichever end is left on the host).
|
|
if ifconfig epair0a >/dev/null 2>&1; then
|
|
ifconfig epair0a destroy
|
|
echo "epair destroyed"
|
|
fi
|