modified preinstall.sh and added regex to change the version

This commit is contained in:
rishwanth1995 2018-03-08 13:43:33 -05:00
parent d3428e926c
commit c767aa975c
3 changed files with 34 additions and 17 deletions

View File

@ -19,7 +19,7 @@
</target>
<property name="VERSION" value="4.6.0"/>
<replaceregexp file="${basedir}/../preinstall.sh" match="VERSION=(.*)" replace="VERSION=${VERSION}" byline="true"/>
<target name="get-thirdparty-dependencies" description="get third-party dependencies">
<!--Copy openCV dependencies to release-->
<copy todir="${modules.dir}" >

View File

@ -87,7 +87,12 @@
<copy file="${basedir}/LICENSE-2.0.txt" tofile="${zip-tmp}/${app.name}/LICENSE-2.0.txt"/>
<copy file="${basedir}/NEWS.txt" tofile="${zip-tmp}/${app.name}/NEWS.txt"/>
<copy file="${basedir}/KNOWN_ISSUES.txt" tofile="${zip-tmp}/${app.name}/KNOWN_ISSUES.txt"/>
<if>
<equals arg1="${os.family}" arg2="unix"/>
<then>
<copy file="${basedir}/preinstall.sh" tofile="${zip-tmp}/${app.name}/preinstall.sh"/>
</then>
</if>
<if>
<equals arg1="${os.family}" arg2="windows"/>
<then>

View File

@ -1,27 +1,39 @@
#!/bin/bash
photorec_filepath=/usr/bin/photorec;
photorec_filepath=/usr/bin/photorec
if [ -f "$photorec_filepath" ]; then
echo "photorec found"
echo "$photorec_filepath found"
else
echo "Photorec not found, please install testdisk for the photorec carver functionality"
echo "run the command: sudo apt-get install testdisk"
exit 1
fi
sleuthkit_jar_filepath=/usr/share/java/sleuthkit-4.6.0.jar;
ext_jar_filepath=./autopsy/modules/ext/sleuthkit-postgresql-4.6.0.jar;
if [ -f "$sleuthkit_jar_filepath" ]; then
echo "sleuthkit jarfile found";
echo "copying sleuthkit-jar file to the autopsy directory";
rm ./autopsy/modules/ext/sleuthkit-postgresql-4.6.0.jar
if [ ! -f "$ext_jar_filepath" ]; then
cp $sleuthkit_jar_filepath ./autopsy/modules/ext/sleuthkit-postgresql-4.6.0.jar;
echo "Successfully copied sleuthkit-jar file";
echo "run autopsy";
VERSION=4.6.0
sleuthkit_jar_filepath=/usr/share/java/sleuthkit-$VERSION.jar;
ext_jar_filepath=$PWD/autopsy/modules/ext/sleuthkit-postgresql-$VERSION.jar;
if [[ -f "$sleuthkit_jar_filepath" ]] && [[ -f "$ext_jar_filepath" ]]; then
echo "$sleuthkit_jar_filepath found"
echo "copying $sleuthkit_jar_filepath to the autopsy directory"
echo "deleting $ext_jar_filepath"
rm $ext_jar_filepath;
if [ "$?" -gt 0 ]; then #checking if remove operation failed
echo "exiting .."
exit 1
else
echo "Successfully removed $ext_jar_filepath"
cp $sleuthkit_jar_filepath $ext_jar_filepath
if [ "$?" -eq 0 ]; then # checking copy operation was successful
echo "Successfully copied $sleuthkit_jar_filepath"
else
echo "exiting..."
exit 1
fi
fi
else
echo "Sleuthkit-jar not found, please install the sleuthkit-java.deb file"
echo "$sleuthkit_jar_filepath not found, please install the sleuthkit-java.deb file"
echo "run the command: sudo apt install ./sleuthkit-java_4.6.0-1_amd64.deb inside the debian file directory"
exit 1
fi
echo "Autopsy is now configured. You can execute bin/autopsy to start it"