2023-08-27 20:29:02 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
set -euo pipefail
|
|
|
|
IFS=$'\n\t'
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
jail_name="$1"
|
|
|
|
|
|
|
|
jail_list=$(poudriere jail -l -n -q)
|
|
|
|
if ! grep -q "${jail_name}" <<<"$jail_list"; then
|
|
|
|
die "No jail named ${jail_name} found."
|
|
|
|
fi
|
|
|
|
|
2024-08-28 22:20:18 +00:00
|
|
|
# We could do
|
|
|
|
# poudriere pkgclean -A -y -j "$jail_name"
|
|
|
|
# instead of the packages line below but we'd need to know every set
|
2023-08-27 20:29:02 +00:00
|
|
|
poudriere jail -d -j "$jail_name" -C all
|
2024-07-04 04:45:54 +00:00
|
|
|
rm -rf /usr/local/poudriere/data/images/${jail_name}-repo \
|
2024-08-11 16:56:35 +00:00
|
|
|
/usr/obj/usr/local/poudriere/jails/${jail_name} \
|
|
|
|
/usr/local/poudriere/data/packages/${jail_name}-*
|
2023-08-27 20:29:02 +00:00
|
|
|
|
|
|
|
echo "Deleted jail $jail_name"
|