#!/bin/bash

# 10/05/2014, author: Maxim Suhanov

#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 2 of the License, or
#    (at your option) any later version.

#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.

#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

VERSION='20140517'
PROGRAMPATH='/usr/libexec/altquire'

# Check dependencies
if [ -z `which dc3dd` ] || [ -z `which lsblk` ] || [ -z `which blkid` ] || [ -z `which blockdev` ] || [ -z `which dialog` ] || [ -z `which grep` ] || [ -z `which awk` ] || [ -z `which strings` ]; then
	echo 'Are you sure that dc3dd, lsblk, blkid, blockdev, dialog, grep, awk and strings were installed?'
	exit 255
fi

# Safely activate Linux RAID and LVM2.
raid-forensic start &> /dev/null
lvm2-forensic start &> /dev/null

cd "$PROGRAMPATH"
msg="Программа \"altquire\" (версия \"$VERSION\") является оболочкой для программы \"dc3dd\". Опытным пользователям рекомендуется использовать названную программу напрямую из командной строки.\n\nДля работы с интерфейсом используйте стрелки на клавиатуре и клавиши Tab, Enter."
dialog --msgbox "$msg" 12 60
exec ./1-select-source.sh
