#!/bin/bash
. ./pack.config

if [ $# -ge 1 ]; then
	MOUNTPOINT=$1
else
        echo Usage $0 /mount/point
	echo Mount point was not provided, using default
	echo
	MOUNTPOINT=$MOUNT_DIR
	if [ -z "$MOUNTPOINT" ]; then
		MOUNTPOINT=/mnt/tmp1
	fi
fi


	echo "Umounting Game from $MOUNTPOINT, please wait..."

	#setup loopback device
#	LOOPBACK_DEV=`losetup -a|grep $IMAGE_FILE|cut -d':' -f1-1`
#	echo Got LoopbackDevice $LOOPBACK_DEV

	umount $MOUNTPOINT
	sleep 1
	cryptsetup close encryptedpack

#ni potrebno
#	losetup -d $LOOPBACK_DEV

	echo "Pack unmounted"
	echo

