-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch_client.sh
More file actions
executable file
·33 lines (27 loc) · 1.08 KB
/
launch_client.sh
File metadata and controls
executable file
·33 lines (27 loc) · 1.08 KB
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
#!/bin/bash
# Launcher for ClipBridge Client on Linux
# Get the directory where this script is located
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
# Check if python3 is available
if ! command -v python3 &> /dev/null; then
echo "❌ Error: python3 could not be found."
exit 1
fi
VENV="$DIR/.venv"
REQ="$DIR/requirements.txt"
if [ ! -d "$VENV" ]; then
echo "📦 Creating virtual environment in .venv ..."
if ! python3 -m venv "$VENV"; then
echo "❌ Failed to create venv. On Debian/Ubuntu try: sudo apt install python3-venv"
exit 1
fi
fi
echo "📦 Ensuring dependencies (flask, requests, pyperclip, cryptography)..."
"$VENV/bin/pip" install -q -r "$REQ" || exit 1
echo "🚀 Starting ClipBridge Client..."
# Usage: ./launch_client.sh → client (foreground sync)
# ./launch_client.sh on → client on (sync + clipbridge> shell)
# ./launch_client.sh off → client off (stop interactive on this PC)
# ./launch_client.sh on --ip 192.168.1.5
exec "$VENV/bin/python" "$DIR/clipbridge.py" client "$@"