Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ quit_application() {
local timeout_duration=10

# check if the application is running
if ! osascript -e "application id \"$bundle_id\" is running" 2>/dev/null; then
local app_running
app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then
return
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
quit_application() {
bundle_id="$1"
timeout_duration=10
if ! osascript -e "application id \"$bundle_id\" is running" >/dev/null 2>&1; then return; fi
app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [ "$app_running" != "true" ]; then return; fi
console_user="$(stat -f "%Su" /dev/console 2>/dev/null || true)"
if [ "$(id -u)" -eq 0 ] && [ "$console_user" = "root" ]; then
echo "Skipping quit for '$bundle_id'."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
quit_app() {
b="$1"
# try a friendly quit if a GUI user is active
if osascript -e "application id \"$b\" is running" >/dev/null 2>&1; then
app_running=$(osascript -e "application id \"$b\" is running" 2>/dev/null)
if [ "$app_running" = "true" ]; then
cu="$(stat -f "%Su" /dev/console 2>/dev/null || true)"
if [ "$(id -u)" -ne 0 ] || [ "$cu" != "root" ]; then
i=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ quit_application() {
local timeout_duration=10

# check if the application is running
if ! osascript -e "application id \"$bundle_id\" is running" 2>/dev/null; then
local app_running
app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then
return
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ quit_application() {
local timeout_duration=10

# check if the application is running
if ! osascript -e "application id \"$bundle_id\" is running" 2>/dev/null; then
local app_running
app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then
return
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ CONSOLE_USER=$(stat -f "%Su" /dev/console 2>/dev/null || echo "")

# Check if Chrome is running (only check once)
CHROME_WAS_RUNNING=false
if osascript -e "application id \"com.google.Chrome\" is running" 2>/dev/null; then
CHROME_RUNNING=$(osascript -e "application id \"com.google.Chrome\" is running" 2>/dev/null)
if [[ "$CHROME_RUNNING" == "true" ]]; then
CHROME_WAS_RUNNING=true
quit_application 'com.google.Chrome' "$CONSOLE_USER"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ quit_application() {
local timeout_duration=10

# check if the application is running
if ! osascript -e "application id \"$bundle_id\" is running" 2>/dev/null; then
local app_running
app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then
return
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ quit_application() {
local timeout_duration=10

# check if the application is running
if ! osascript -e "application id \"$bundle_id\" is running" 2>/dev/null; then
local app_running
app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then
return
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ CONSOLE_USER=$(stat -f "%Su" /dev/console 2>/dev/null || echo "")
# Quit Logi Tune gracefully before the PKG's preinstall force-kills it. The
# PKG's default RUNAPP choice relaunches the app for logged-in console users
# after installation, so no relaunch step is needed here.
if osascript -e "application id \"com.logitech.logitune\" is running" 2>/dev/null; then
LOGITUNE_RUNNING=$(osascript -e "application id \"com.logitech.logitune\" is running" 2>/dev/null)
if [[ "$LOGITUNE_RUNNING" == "true" ]]; then
quit_application 'com.logitech.logitune' "$CONSOLE_USER"
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ quit_application() {
local timeout_duration=10

# check if the application is running
if ! osascript -e "application id \"$bundle_id\" is running" 2>/dev/null; then
local app_running
app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then
return
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ quit_application() {
local timeout_duration=10

# check if the application is running
if ! osascript -e "application id \"$bundle_id\" is running" 2>/dev/null; then
local app_running
app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then
return
fi

Expand Down
3 changes: 2 additions & 1 deletion ee/maintained-apps/inputs/homebrew/scripts/p4v-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
quit_application() {
local bundle_id="$1"
local timeout_duration=10
if ! osascript -e "application id \"$bundle_id\" is running" >/dev/null 2>&1; then return; fi
local app_running; app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then return; fi
local console_user; console_user=$(stat -f "%Su" /dev/console)
if [[ $EUID -eq 0 && "$console_user" == "root" ]]; then echo "Skipping quit for '$bundle_id'."; return; fi
echo "Quitting '$bundle_id'..."
Expand Down
3 changes: 2 additions & 1 deletion ee/maintained-apps/inputs/homebrew/scripts/p4v-uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
quit_application() {
local bundle_id="$1"
local timeout_duration=10
if ! osascript -e "application id \"$bundle_id\" is running" >/dev/null 2>&1; then return; fi
local app_running; app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then return; fi
local console_user; console_user=$(stat -f "%Su" /dev/console)
if [[ $EUID -eq 0 && "$console_user" == "root" ]]; then return; fi
SECONDS=0
Expand Down
4 changes: 3 additions & 1 deletion ee/maintained-apps/inputs/homebrew/scripts/slack_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ quit_application() {
local timeout_duration=10

# check if the application is running
if ! osascript -e "application id \"$bundle_id\" is running" 2>/dev/null; then
local app_running
app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
if [[ "$app_running" != "true" ]]; then
return
fi

Expand Down
3 changes: 2 additions & 1 deletion ee/maintained-apps/inputs/homebrew/scripts/zoom_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ CONSOLE_USER=$(stat -f "%Su" /dev/console 2>/dev/null || echo "")

# Check if Zoom is running
ZOOM_WAS_RUNNING=false
if osascript -e "application id \"us.zoom.xos\" is running" 2>/dev/null; then
ZOOM_RUNNING=$(osascript -e "application id \"us.zoom.xos\" is running" 2>/dev/null)
if [[ "$ZOOM_RUNNING" == "true" ]]; then
ZOOM_WAS_RUNNING=true
quit_application 'us.zoom.xos' "$CONSOLE_USER"
fi
Expand Down
Loading
Loading