Final Update spoolman-install.sh

This commit is contained in:
CanbiZ 2024-06-13 13:11:34 +02:00 committed by GitHub
parent c34c0afa82
commit 991ef1b734
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,42 +16,37 @@ network_check
update_os update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y --no-install-recommends \ $STD apt-get install -y \
build-essential \ build-essential \
curl \ curl \
unzip \
sudo \ sudo \
jq \
git \
make \ make \
libpq-dev \ libpq-dev \
gnupg \ unzip \
gpg \
ca-certificates \ ca-certificates \
mc mc
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing Python3" msg_info "Installing Python3"
$STD apt-get install -y \ $STD apt-get install -y \
python3 \
python3-dev \ python3-dev \
python3-setuptools \ python3-setuptools \
python3-wheel \ python3-wheel \
python3-pip \ python3-pip
python3-venv
msg_ok "Installed Python3" msg_ok "Installed Python3"
msg_info "Installing Spoolman" msg_info "Installing Spoolman"
cd /opt cd /opt
RELEASE=$(wget -q https://github.com/Donkie/Spoolman/releases/latest -O - | grep "title>Release" | cut -d " " -f 4) RELEASE=$(wget -q https://github.com/Donkie/Spoolman/releases/latest -O - | grep "title>Release" | cut -d " " -f 4)
cd /opt
wget -q https://github.com/Donkie/Spoolman/releases/download/$RELEASE/spoolman.zip wget -q https://github.com/Donkie/Spoolman/releases/download/$RELEASE/spoolman.zip
unzip -q spoolman.zip -d spoolman unzip -q spoolman.zip -d spoolman
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt rm -rf spoolman.zip
cd spoolman cd spoolman
$STD python3 -m venv .venv
$STD source .venv/bin/activate
$STD pip3 install -r requirements.txt $STD pip3 install -r requirements.txt
cp .env.example .env cp .env.example .env
chmod +x scripts/*.sh echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Spoolman" msg_ok "Installed Spoolman"
msg_info "Creating Service" msg_info "Creating Service"
@ -59,15 +54,13 @@ cat <<EOF >/etc/systemd/system/spoolman.service
[Unit] [Unit]
Description=Spoolman Description=Spoolman
After=network.target After=network.target
[Service] [Service]
Type=simple Type=simple
WorkingDirectory=/opt/spoolman WorkingDirectory=/opt/spoolman
EnvironmentFile=/opt/spoolman/.env EnvironmentFile=/opt/spoolman/.env
ExecStart=/opt/spoolman/scripts/start.sh ExecStart=uvicorn spoolman.main:app --host 0.0.0.0 --port 7912
Restart=always Restart=always
User=root User=root
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF