#!/bin/sh -Cefux set -Cefux cd /root/files/embedded/qemu || exit 1 name="$1" base_dir=/root/files/qemus dir="$base_dir/$name" lock="$dir/.lock" if [ "${2:-}" != run ] then lockf -t 0 "$lock" "$0" "$name" run exit fi img="$dir/.img" fs="/dev/ufs/qemu-$name" mdconfig -du md100 || true mdconfig -u md100 -f "$img" fsck -y "$fs" mdconfig -du md100