Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1b73d47765
Fetching contributors…

Cannot retrieve contributors at this time

executable file 27 lines (22 sloc) 0.619 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/bin/sh

CACHE_LOCATION="/mnt/cache"
UNION_LOCATION="/mnt/union"

processes="$(lsof -t "$UNION_LOCATION")"

if [ -n "$processes" ]; then
echo "Some processes are still using the mirror, kill anyway?"
read answer
if [ "$answer" = "y" -o "$answer" = "yes" ]; then
echo "$processes" | xargs kill
else
exit
fi
fi

# This is inelegant, but I don't care
umount -l "$UNION_LOCATION"/tmp
umount -l "$UNION_LOCATION"/proc
umount -l "$UNION_LOCATION"/sys
umount -l "$UNION_LOCATION"/dev/shm
umount -l "$UNION_LOCATION"/dev/pts
umount -l "$UNION_LOCATION"/dev
umount -l "$UNION_LOCATION"/

umount -l "$CACHE_LOCATION"
Something went wrong with that request. Please try again.