added files for live_Cd

This commit is contained in:
rishwanth1995 2018-08-16 16:59:38 -04:00
parent 418e202079
commit d63167fd91
4 changed files with 27 additions and 23 deletions

BIN
unix/autopsy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
unix/autopsy_wallpaper1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
unix/autopsy_wallpaper2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -25,24 +25,22 @@ errorLog () {
} }
#Verify we can find the script #Verify we can find the script
if [[ -x "$AUTOPSY_BIN" ]]; then if [[ ! -x "$AUTOPSY_BIN" ]]; then
infoLog "Autopsy found" errorLog "Autopsy binaries not found at $AUTOPSY_BIN. Exiting....."
else
errorLog "Autopsy binaries not found at $AUTOPSY_BIN. Exiting....."
fi fi
# Create folders on external drive # Create folders on external drive
createConfigDirectories () { createConfigDirectories () {
if [ ! -d "$1" ]; then
mkdir $1
if [ ! -d "$1" ]; then if [ ! -d "$1" ]; then
mkdir $1 errorLog "error while creating $1"
if [ ! -d "$1" ]; then else
errorLog "error while creating $1" infoLog "$1 successfully created"
else
infoLog "$1 successfully created"
fi
fi fi
return 0 fi
return 0
} }
@ -53,23 +51,29 @@ showAndReadOptions () {
echo "Select a mounted disk to create config directory" echo "Select a mounted disk to create config directory"
# Maintainers: Adjust these grep statements based on where your # Maintainers: Adjust these grep statements based on where your
# platform mounts media. # platform mounts media.
mnt=( $(mount | grep "media" | grep "rw" | awk '{print $3}') ) mnt=( $(findmnt -lo source,target,fstype,label,options,size | grep "media" | grep "rw" | awk '{print $1, $2, $4, $6}') )
# Add option to user to not use mounted media
length=${#mnt[@]} length=${#mnt[@]}
mnt[length]="Do not store on mounted disk" mnt[length]="Do not store on mounted disk"
options_length=$(( length + 1 )) options_length=$(( length / 4 + 1 ))
if [ $length -gt 0 ]; then
printf "%10s\t%10s\t%10s\t%10s\t%10s\n" "OPTION" "SOURCE" "TARGET" "LABEL" "SIZE"
fi
x=1 for ((i=0;i< $options_length;i++));
for word in "${mnt[@]}"
do do
echo [$x] "${word}" printf "%10s\t" "[$(( i+1 ))]"
x=$((x + 1)) for((j=0;j<4;j++));
do
printf "%10s\t" "${mnt[j + i * 4]}"
done
echo
done done
read -n 1 option read -n 1 option
if [[ $option = "" ]] || ! [[ "$option" =~ ^[0-9]+$ ]]; then if [[ $option = "" ]] || ! [[ "$option" =~ ^[0-9]+$ ]]; then
echo "Please choose a valid option" echo "Please choose a valid option"
showAndReadOptions showAndReadOptions
fi fi
} }
@ -85,7 +89,7 @@ do
done done
if [ "$option" != "$options_length" ]; then if [ "$option" != "$options_length" ]; then
index=$(( option - 1 )) index=$(( (option - 1) * 4 + 1 ))
echo "Autopsy configurations will be stored in" "${mnt[$index]}"". Are you sure? (y/n)" echo "Autopsy configurations will be stored in" "${mnt[$index]}"". Are you sure? (y/n)"
read affirmation read affirmation
if [ "$affirmation" == "y" ] || [ "$affirmation" == "Y" ]; then if [ "$affirmation" == "y" ] || [ "$affirmation" == "Y" ]; then
@ -106,9 +110,9 @@ if [ "$option" != "$options_length" ]; then
createConfigDirectories $autopsyConfigDir && createConfigDirectories $userDirectory createConfigDirectories $autopsyConfigDir && createConfigDirectories $userDirectory
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
sh $AUTOPSY_BIN --userdir $userDirectory sh $AUTOPSY_BIN --userdir $userDirectory
fi fi
fi fi
else else
sh $AUTOPSY_BIN sh $AUTOPSY_BIN
fi fi