#!/bin/sh 
# test if firewall accepts signed apps
SIGNED_APPS_EXCEPTION=$(/usr/libexec/ApplicationFirewall/socketfilterfw --getallowsigned | grep "Automatically allow signed built-in software ENABLED" | wc -l)
if [ "$SIGNED_APPS_EXCEPTION" -eq "1" ]; then
    # then remove fwcld, it should not be in the list as it must be correctly signed
    /usr/libexec/ApplicationFirewall/socketfilterfw --remove /usr/local/sbin/FileWave.app/Contents/MacOS/fwcld
fi
#patch to safely upgrade from qt 5.12 to 5.15
mv /Library/Frameworks/FileWaveCore.framework/plugins/ /Library/Frameworks/FileWaveCore.framework/plugins.bak

# we removed the observe client files
rm -f /private/LaunchAgents/com.filewave.fwVNCServer.plist /usr/local/sbin/filewave-vnc-server /usr/local/etc/.fwVNCServerAuth /var/log/fwVNCServer.log

# we removed the zmq broker
rm -f /usr/local/sbin/FileWave.app/Contents/MacOS/fwzmqbroker

/etc/periodic/daily/99.restartFW-shell-script 
