-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclose_komodo.sh
More file actions
executable file
·34 lines (28 loc) · 890 Bytes
/
Copy pathclose_komodo.sh
File metadata and controls
executable file
·34 lines (28 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
set -eu
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname "$0")" && pwd)"
REPO_DIR="$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)"
LOCAL_DIR="$REPO_DIR/.local"
PROFILE_DIR="${1:-${KOMODO_PROFILE_DIR:-$LOCAL_DIR/playwright-komodo-profile}}"
ENV_FILE="${KOMODO_ENV_FILE:-$LOCAL_DIR/komodo-env.sh}"
pids="$(ps aux | awk -v profile="$PROFILE_DIR" '
index($0, profile) && !index($0, "awk -v profile=") {
print $2
}
')"
if [ -n "$pids" ]; then
for pid in $pids; do
kill "$pid" 2>/dev/null || true
done
printf '%s\n' "Closed dedicated Komodo browser/profile processes for $PROFILE_DIR."
else
printf '%s\n' "No dedicated Komodo browser/profile processes found for $PROFILE_DIR."
fi
rm -f \
"$PROFILE_DIR/SingletonLock" \
"$PROFILE_DIR/SingletonSocket" \
"$PROFILE_DIR/SingletonCookie"
if [ -f "$ENV_FILE" ]; then
rm -f "$ENV_FILE"
printf '%s\n' "Removed $ENV_FILE"
fi