Update wastebin-install.sh

Refactor
Fixes https://github.com/tteck/Proxmox/issues/3465
This commit is contained in:
tteckster 2024-08-04 17:07:52 -04:00 committed by GitHub
parent 341e873eba
commit d21760cc65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 22 deletions

View File

@ -15,30 +15,20 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies"
$STD apt-get install -y --no-install-recommends \ $STD apt-get install -y curl
build-essential \ $STD apt-get install -y sudo
unzip \ $STD apt-get install -y mc
curl \
sudo \
git \
make \
mc
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing Rust (Patience)"
$STD bash <(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs) -y
source ~/.cargo/env
msg_ok "Installed Rust"
msg_info "Installing Wastebin (Patience)" msg_info "Installing Wastebin (Patience)"
RELEASE=$(curl -s https://api.github.com/repos/matze/wastebin/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') RELEASE=$(curl -s https://api.github.com/repos/matze/wastebin/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
wget -q "https://github.com/matze/wastebin/archive/refs/tags/${RELEASE}.zip" wget -q https://github.com/matze/wastebin/releases/download/${RELEASE}/wastebin_${RELEASE}_x86_64-unknown-linux-musl.tar.zst
unzip -q ${RELEASE}.zip tar -xf wastebin_${RELEASE}_x86_64-unknown-linux-musl.tar.zst
mv wastebin-${RELEASE} /opt/wastebin rm -rf wastebin_${RELEASE}_x86_64-unknown-linux-musl.tar.zst
rm -R ${RELEASE}.zip mkdir -p /opt/wastebin
cd /opt/wastebin mv wastebin /opt/wastebin/
cargo build -q --release chmod +x /opt/wastebin/wastebin
msg_ok "Installed Wastebin" msg_ok "Installed Wastebin"
msg_info "Creating Service" msg_info "Creating Service"
@ -48,9 +38,8 @@ Description=Start Wastebin Service
After=network.target After=network.target
[Service] [Service]
User=root
WorkingDirectory=/opt/wastebin WorkingDirectory=/opt/wastebin
ExecStart=/root/.cargo/bin/cargo run --release --quiet ExecStart=/opt/wastebin/wastebin
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target