Fixed timezone script for macOS and a typo

This commit is contained in:
Patrick Neumann 2020-12-02 17:37:14 +01:00
parent 7761737094
commit 64e2de02e0
2 changed files with 8 additions and 14 deletions

View File

@ -10,7 +10,7 @@
# 01-ewfinfo # 01-ewfinfo
# #
# USAGE: # USAGE:
# Right klick on the first file of an EWF image and # Right click on the first file of an EWF image and
# choose this nautilus script from the context menu. # choose this nautilus script from the context menu.
# #
# OPTIONS: # OPTIONS:

View File

@ -2,15 +2,15 @@
#=============================================================================== #===============================================================================
# #
# DIRECTORY: # DIRECTORY:
# /home/*/.local/share/nautilus/scripts/05b_macOS/ # /home/*/.local/share/nautilus/scripts/05b-macOS/
# OR # OR
# /home/*/.gnome2/nautilus-sctipts/05b_macOS/ (deprecated) # /home/*/.gnome2/nautilus-sctipts/05b-macOS/ (deprecated)
# #
# FILE: # FILE:
# 02_timezone # 02-E01-timezone
# #
# USAGE: # USAGE:
# Right klick on an EWF (or RAW) image and # Right click on the first file of an EWF image and
# choose this nautilus script from the context menu. # choose this nautilus script from the context menu.
# #
# OPTIONS: # OPTIONS:
@ -102,8 +102,6 @@ check_dep "${MMLS_BIN}" "sleuthkit"
check_dep "${PLUTIL_BIN}" "libplist-utils" check_dep "${PLUTIL_BIN}" "libplist-utils"
check_dep "${RM_BIN}" "coreutils" check_dep "${RM_BIN}" "coreutils"
check_dep "${SED_BIN}" "sed" check_dep "${SED_BIN}" "sed"
# https://raw.githubusercontent.com/casualscripter/debian-stuff
check_dep "${PPEPY_BIN}" "print_plist_entry.py" check_dep "${PPEPY_BIN}" "print_plist_entry.py"
check_ext "${SOURCE}" "[eE]01" check_ext "${SOURCE}" "[eE]01"
@ -144,18 +142,14 @@ if ${FSSTAT_BIN} -o "${OFFSET}" "${SOURCE}" > /dev/null 2>&1 ; then
-n "/Library/Preferences/.GlobalPreferences.plist" \ -n "/Library/Preferences/.GlobalPreferences.plist" \
"${SOURCE}" )" "${SOURCE}" )"
if [ "${pref}" != "File not found" ] ; then if [ "${pref}" != "File not found" ] ; then
if [ ! -f "${TMP}/GlobalPreferences.plist" ] ; then if [ ! -f "${TMP}/${OFFSET}-GlobalPreferences.plist" ] ; then
if ! ${ICAT_BIN} -o "${OFFSET}" "${SOURCE}" "${pref}" > "/tmp/${pref}.plist" ; then if ! ${ICAT_BIN} -o "${OFFSET}" "${SOURCE}" "${pref}" > "${TMP}/${OFFSET}-GlobalPreferences.plist" ; then
echo " During the execution of icat an error occurred." >> "${TIMEZONE}" echo " During the execution of icat an error occurred." >> "${TIMEZONE}"
fi fi
${PLUTIL_BIN} --format xml --infile "/tmp/${pref}.plist" --outfile "${TMP}/GlobalPreferences.plist"
${RM_BIN} "/tmp/${pref}.plist"
# since 10.10 (Yosemite) it seems, that the converted XML is not well formed!?
#${SED_BIN} --in-place --regexp-extended '/<key>AppleLanguages<\/key>/,/<\/array>/ s/string/key/g' "${TMP}/GlobalPreferences.plist"
fi fi
echo -e -n " Some content from \".GlobalPreferences.plist\":\n " \ echo -e -n " Some content from \".GlobalPreferences.plist\":\n " \
>> "${TIMEZONE}" >> "${TIMEZONE}"
${PPEPY_BIN} "${TMP}/GlobalPreferences.plist" TimeZoneName \ ${PPEPY_BIN} "${TMP}/${OFFSET}-GlobalPreferences.plist" TimeZoneName \
>> "${TIMEZONE}" >> "${TIMEZONE}"
echo >> "${TIMEZONE}" echo >> "${TIMEZONE}"
else else