machine_setup/ansible/roles/poudriere/files/poudriere_delete_jail.bash

17 lines
333 B
Bash
Raw Normal View History

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
poudriere jail -d -j "$jail_name" -C all
echo "Deleted jail $jail_name"