From e4e6beadb14ebee829a33725cd9e5f3622c05fc7 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 21 Oct 2018 23:27:47 -0700 Subject: [PATCH] Don't unload the XQuartzFixer job if it doesn't exist. But *do* get rid of the pre-launchd XQuartzFixer startup item; it's probably not there, but we might as well leave things as clean as we can. Change-Id: Icfdbe6c0d022cde8cf30bd3c79fbf77896e6fe98 Reviewed-on: https://code.wireshark.org/review/30322 Reviewed-by: Guy Harris --- .../macosx/Scripts/wireshark-postinstall.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packaging/macosx/Scripts/wireshark-postinstall.sh b/packaging/macosx/Scripts/wireshark-postinstall.sh index a57690b622..98667c43e1 100755 --- a/packaging/macosx/Scripts/wireshark-postinstall.sh +++ b/packaging/macosx/Scripts/wireshark-postinstall.sh @@ -42,10 +42,18 @@ fi echo $WSMANPATH > /etc/manpaths.d/Wireshark # -# Get rid of the old XQuartz fixer; we don't use X11, and haven't used -# it since Wireshark 2.0, so we don't need it. +# If we still have the old XQuartz fixer, get rid of it; we don't use +# X11, and haven't used it since Wireshark 2.0, so we don't need it. # XQUARTZ_FIXER_PLIST="/Library/LaunchDaemons/org.wireshark.XQuartzFixer.plist" -launchctl unload $XQUARTZ_FIXER_PLIST -rm -rf /Library/Application Support/Wireshark/XQuartzFixer -rm -f $XQUARTZ_FIXER_PLIST +if [ -e "$XQUARTZ_FIXER_PLIST ] +then + launchctl unload $XQUARTZ_FIXER_PLIST + rm -rf /Library/Application Support/Wireshark/XQuartzFixer + rm -f $XQUARTZ_FIXER_PLIST +fi + +# +# And get rid of the *really* old XQuartz fixer while we're at it. +# +rm -rf /Library/StartupItems/XQuartzFixer