-
Notifications
You must be signed in to change notification settings - Fork 597
/
add_macos_jna.sh
44 lines (37 loc) · 1.15 KB
/
add_macos_jna.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Updates jna paths for mac
usage() {
echo "Usage: add_macos_jna.sh [-i base_install_location (i.e. /home/usr/autopsy)] [-a application_name (default: autopsy)]" 1>&2
}
APPLICATION_NAME="autopsy"
while getopts "a:i:" o; do
case "${o}" in
i)
INSTALL_LOC=${OPTARG}
;;
a)
APPLICATION_NAME=${OPTARG}
;;
*)
usage
exit 1
;;
esac
done
if [[ -z "$INSTALL_LOC" ]]
then
usage
exit 1
fi
GSTREAMER_LOC=$(brew --prefix gstreamer)
if [[ $? -ne 0 ]]
then
echo "Unable to find homebrew installation of gstreamer" >> /dev/stderr
exit 1
fi
awk '!/^ *#? *export +?(jreflags|GST_PLUGIN_SYSTEM_PATH|GST_PLUGIN_SCANNER)=.*$/' $INSTALL_LOC/etc/$APPLICATION_NAME.conf > $INSTALL_LOC/etc/$APPLICATION_NAME.conf.tmp && \
mv $INSTALL_LOC/etc/$APPLICATION_NAME.conf.tmp $INSTALL_LOC/etc/$APPLICATION_NAME.conf && \
echo "
export jreflags=\"-Djna.library.path=\\\"/usr/local/lib\\\" \$jreflags\"
export GST_PLUGIN_SYSTEM_PATH=\"/usr/local/lib/gstreamer-1.0\"
export GST_PLUGIN_SCANNER=\"${GSTREAMER_LOC}/libexec/gstreamer-1.0/gst-plugin-scanner\"" >> $INSTALL_LOC/etc/$APPLICATION_NAME.conf