#!/bin/sh slot=$1 #Audit slot and release names case $slot in *[^a-zA-Z0-9]* ) echo "Non-alphanumeric slot $slot"; exit 1 esac if [ -z "$slot" ]; then echo "Zero-length slot or release" exit 1 fi if [ ! -d /scratch/$slot ]; then echo "No file system for slot!" exit 1 fi jail -r $slot umount -f /scratch/$slot/dev || true umount -f /scratch/$slot || true chflags -R noschg /scratch/tmp/$slot rm -rf /scratch/tmp/$slot /scratch/$slot exit 0