mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Merge pull request #3772 from rishwanth1995/correct_codacy
removed codacy issues
This commit is contained in:
commit
20546e44cf
34
unix/launch_script_bootable.sh
Executable file → Normal file
34
unix/launch_script_bootable.sh
Executable file → Normal file
@ -24,14 +24,23 @@ errorLog () {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Verify we can find the script
|
||||
[ -x "$AUTOPSY_BIN" ] && infoLog "Autopsy found" || errorLog "Autopsy binaries not found at $AUTOPSY_BIN. Exiting....."
|
||||
Verify we can find the script
|
||||
if [[ -x "$AUTOPSY_BIN" ]]; then
|
||||
infoLog "Autopsy found"
|
||||
else
|
||||
errorLog "Autopsy binaries not found at $AUTOPSY_BIN. Exiting....."
|
||||
fi
|
||||
|
||||
|
||||
# Create folders on external drive
|
||||
createConfigDirectories () {
|
||||
if [ ! -d "$1" ]; then
|
||||
mkdir $1 && infoLog "$1 successfully created" || errorLog "error while creating $1"
|
||||
mkdir $1
|
||||
if [ ! -d "$1" ]; then
|
||||
errorLog "error while creating $1"
|
||||
else
|
||||
infoLog "$1 successfully created"
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
@ -49,13 +58,13 @@ showAndReadOptions () {
|
||||
# Add option to user to not use mounted media
|
||||
length=${#mnt[@]}
|
||||
mnt[length]="Do not store on mounted disk"
|
||||
options_length=$(( $length + 1 ))
|
||||
options_length=$(( length + 1 ))
|
||||
|
||||
x=1
|
||||
for word in "${mnt[@]}"
|
||||
do
|
||||
echo [$x] "${word}"
|
||||
x=$(($x + 1))
|
||||
x=$((x + 1))
|
||||
done
|
||||
read option
|
||||
}
|
||||
@ -72,12 +81,21 @@ do
|
||||
done
|
||||
|
||||
if [ "$option" != "$options_length" ]; then
|
||||
index=$(( $option - 1 ))
|
||||
index=$(( option - 1 ))
|
||||
echo "Autopsy configurations will be stored in" "${mnt[$index]}"". Are you sure? (y/n)"
|
||||
read affirmation
|
||||
if [ "$affirmation" == "y" ] || [ "$affirmation" == "Y" ]; then
|
||||
[ -d "${mnt[$index]}" ] && selectedMount=${mnt[$index]} || errorLog "Mount point not found"
|
||||
[ -w "$selectedMount" ] && autopsyConfigDir="${mnt[$index]}/AutopsyConfig" || errorLog "Mount point $selectedMount does not have write permission"
|
||||
if [[ -d "${mnt[$index]}" ]]; then
|
||||
selectedMount=${mnt[$index]}
|
||||
else
|
||||
errorLog "Mount point not found"
|
||||
fi
|
||||
|
||||
if [[ -w "$selectedMount" ]]; then
|
||||
autopsyConfigDir="${mnt[$index]}/AutopsyConfig"
|
||||
else
|
||||
errorLog "Mount point $selectedMount does not have write permission"
|
||||
fi
|
||||
|
||||
# Make the directories on the media
|
||||
userDirectory="$autopsyConfigDir/userdir"
|
||||
|
Loading…
x
Reference in New Issue
Block a user