Skip to content

Commit 4194895

Browse files
committed
feat: enhance Raspberry Pi setup script with optional skip-install feature and update README instructions
1 parent 8acce6f commit 4194895

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,17 @@ Admin panel: `http://SERVER_IP:3000/admin` (admin@example.com / admin123)
3333

3434
### 2. Setup Each Raspberry Pi
3535

36-
Each Pi only needs **2 things**: the server IP and its floor number.
36+
Each Pi only needs **2 things**: the server IP and its floor number.
37+
If the machine already has Chromium/X11 installed (e.g. you prepared the VM earlier), you can skip the large browser download with the `--skip-install` option.
3738

3839
```bash
39-
# On each Pi — just change the IP and floor number
40+
# fresh installation (runs package installer)
4041
sudo bash setup.sh --server http://SERVER_IP:3000 --floor 1
4142
sudo reboot
43+
44+
# skip network-heavy package install
45+
sudo bash setup.sh --server http://SERVER_IP:3000 --floor 1 --skip-install
46+
sudo reboot
4247
```
4348

4449
Or remote one-liner:

pi-node/setup.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ SERVER_URL=""
1010
FLOOR_ID=""
1111
INSTALL_DIR="/opt/display-node"
1212

13+
SKIP_INSTALL=false
1314
while [[ $# -gt 0 ]]; do
1415
case $1 in
1516
--server|--server-url) SERVER_URL="$2"; shift 2;;
1617
--floor|--floor-id) FLOOR_ID="$2"; shift 2;;
18+
--skip-install) SKIP_INSTALL=true; shift ;;
1719
*) echo "Unknown option: $1"; exit 1;;
1820
esac
1921
done
2022

23+
# validate required options
2124
if [[ -z "$SERVER_URL" || -z "$FLOOR_ID" ]]; then
22-
echo "Usage: sudo bash setup.sh --server <URL> --floor <ID>"
25+
echo "Usage: sudo bash setup.sh --server <URL> --floor <ID> [--skip-install]"
2326
echo "Example: sudo bash setup.sh --server http://192.168.1.50:3000 --floor 1"
2427
exit 1
2528
fi
@@ -30,9 +33,20 @@ echo "Floor: $FLOOR_ID"
3033
echo ""
3134

3235
# ── 1. Install dependencies ──
33-
echo "[1/5] Installing packages..."
34-
apt-get update -qq
35-
apt-get install -y -qq chromium-browser xserver-xorg x11-xserver-utils xinit openbox unclutter curl
36+
if ! $SKIP_INSTALL; then
37+
echo "[1/5] Installing packages (if missing)..."
38+
apt-get update -qq
39+
# only install browser if not already present to avoid repeated huge downloads
40+
if ! command -v chromium-browser >/dev/null 2>&1; then
41+
apt-get install -y -qq chromium-browser
42+
else
43+
echo "chromium-browser already installed, skipping"
44+
fi
45+
# the other utilities are small
46+
apt-get install -y -qq xserver-xorg x11-xserver-utils xinit openbox unclutter curl
47+
else
48+
echo "[1/5] Skipping package installation as requested"
49+
fi
3650

3751
# ── 2. Write config (only 2 values needed) ──
3852
echo "[2/5] Writing config..."

0 commit comments

Comments
 (0)