Skip to content

Commit

Permalink
Merge pull request #483 from amadotejada/main
Browse files Browse the repository at this point in the history
Check for Zoom Meetings, --check-activity
  • Loading branch information
grahampugh committed Feb 14, 2024
2 parents 6d63be2 + 41da534 commit 311d0d2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions erase-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,21 @@ check_fmm() {
fi
}

# -----------------------------------------------------------------------------
# Checks for certain activities, currently only supports Zoom meetings.
# Exits out if activity is detected.
# Called when --check-activty option is used.
# -----------------------------------------------------------------------------
check_for_activity() {
zoomInMeeting=$(lsof -i 4UDP | grep zoom | awk 'END{print NR}')
if [ "$zoomInMeeting" -gt 1 ]; then
writelog "[$script_name] Active Zoom meeting detected. Exiting."
exit 0
else
writelog "[$script_name] No active Zoom meetings detected. Continuing."
fi
}

# -----------------------------------------------------------------------------
# Download mist if not present and not --silent mode
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -2444,6 +2459,7 @@ show_help() {
--kc-service The name of the key containing the account and password
--silent Silent mode. No dialogs. Requires use of keychain (--kc mode) for Apple Silicon
to provide a password, or the --credentials/--very-insecure-mode mode.
--check-activty If certain activity is detected, the script exits. Currently only supports Zoom meetings.
--quiet Remove output from mist during installer download. Note that no progress
is shown.
--preservecontainer Preserves other volumes in your APFS container when using --erase
Expand Down Expand Up @@ -2644,6 +2660,8 @@ while test $# -gt 0 ; do
;;
-c|--confirm) confirm="yes"
;;
--check-activity) check_for_activity="yes"
;;
--beta) beta="yes"
;;
--preservecontainer) preservecontainer="yes"
Expand Down Expand Up @@ -2777,6 +2795,9 @@ while test $# -gt 0 ; do
shift
credentials="$1"
;;
--check-activity)
shift
;;
--confirmation-icon)
shift
custom_icon="yes"
Expand Down Expand Up @@ -2979,6 +3000,11 @@ elif [[ ($overwrite == "yes" && $update_installer == "yes") || ($replace_invalid
exit 1
fi

# check for user activity
if [[ $check_for_activity == "yes" ]]; then
check_for_activity
fi

# different dialog icon for OS older than macOS 13
if [[ $(echo "$system_version_major < 13" | bc) == 1 ]]; then
dialog_confirmation_icon="/System/Applications/System Preferences.app"
Expand Down

0 comments on commit 311d0d2

Please sign in to comment.