-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-karmen-on-pws.sh
32 lines (24 loc) · 1.12 KB
/
install-karmen-on-pws.sh
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
#!/bin/bash
# Adds karmen on PWS printer (Klipper firmware, systemd based on debian)
#
# Run following command on printer to install:
# curl -s https://raw.githubusercontent.com/fragaria/karmen-gists/v0.0.5/install-karmen-on-pws.sh | sudo -E bash -xs DEVICE_KEY
set -e # exit on error
set -u # error on undefined
DEVICE_KEY="${1:-}"
if [ "$DEVICE_KEY" = "" ]; then
echo "Missing device key parameter."
exit 255
fi
# NodeJS
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
# Websocket Proxy
curl -s https://raw.githubusercontent.com/fragaria/karmen-gists/v0.0.6/ws-install.sh | sudo -E bash -xs "$DEVICE_KEY"
# karmen-pws-connector
curl -s https://raw.githubusercontent.com/fragaria/karmen-pws-connector/v0.0.4/install.sh | sudo -E bash -xs