Files
ProxmoxVE/install/spoolman-install.sh

73 lines
1.7 KiB
Bash
Raw Normal View History

2024-06-13 13:38:29 +02:00
#!/usr/bin/env bash
# Copyright (c) 2021-2025 tteck
2024-06-13 13:38:29 +02:00
# Author: tteck
# Co-Author: MickLesk (Canbiz)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
2024-06-13 13:38:29 +02:00
# Source: https://github.com/Donkie/Spoolman
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
2024-06-13 13:38:29 +02:00
build-essential \
make \
libpq-dev \
ca-certificates
2024-06-13 13:38:29 +02:00
msg_ok "Installed Dependencies"
msg_info "Setup Python3"
$STD apt install -y \
2024-06-13 13:38:29 +02:00
python3-dev \
python3-setuptools \
python3-wheel \
python3-pip
msg_ok "Setup Python3"
2024-06-13 13:38:29 +02:00
msg_info "Installing Spoolman"
RELEASE=$(curl -fsSL https://github.com/Donkie/Spoolman/releases/latest | grep "title>Release" | cut -d " " -f 4)
2024-06-13 13:38:29 +02:00
cd /opt
curl -fsSL "https://github.com/Donkie/Spoolman/releases/download/$RELEASE/spoolman.zip" -o "spoolman.zip"
$STD unzip spoolman.zip -d spoolman
2024-06-13 13:38:29 +02:00
rm -rf spoolman.zip
cd spoolman
2025-10-17 16:07:01 +02:00
$STD pip3 install --upgrade --ignore-installed -r requirements.txt
curl -fsSL "https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example" -o ".env"
2024-06-13 13:38:29 +02:00
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Spoolman"
msg_info "Creating Service"
2025-08-14 14:14:59 +02:00
cat <<'EOF' >/etc/systemd/system/spoolman.service
2024-06-13 13:38:29 +02:00
[Unit]
Description=Spoolman
After=network.target
2025-08-14 14:14:59 +02:00
2024-06-13 13:38:29 +02:00
[Service]
Type=simple
WorkingDirectory=/opt/spoolman
EnvironmentFile=/opt/spoolman/.env
2025-08-14 14:14:59 +02:00
ExecStart=uvicorn spoolman.main:app --host "${SPOOLMAN_HOST}" --port "${SPOOLMAN_PORT}"
2024-06-13 13:38:29 +02:00
Restart=always
User=root
2025-08-14 14:14:59 +02:00
2024-06-13 13:38:29 +02:00
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now spoolman
2024-06-13 13:38:29 +02:00
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt -y autoremove
$STD apt -y autoclean
$STD apt -y clean
2024-06-13 13:38:29 +02:00
msg_ok "Cleaned"