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

View File

@ -15,30 +15,20 @@ setting_up_container
network_check
update_os
msg_info "Installing Dependencies (Patience)"
$STD apt-get install -y --no-install-recommends \
build-essential \
unzip \
curl \
sudo \
git \
make \
mc
msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
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)"
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"
unzip -q ${RELEASE}.zip
mv wastebin-${RELEASE} /opt/wastebin
rm -R ${RELEASE}.zip
cd /opt/wastebin
cargo build -q --release
wget -q https://github.com/matze/wastebin/releases/download/${RELEASE}/wastebin_${RELEASE}_x86_64-unknown-linux-musl.tar.zst
tar -xf wastebin_${RELEASE}_x86_64-unknown-linux-musl.tar.zst
rm -rf wastebin_${RELEASE}_x86_64-unknown-linux-musl.tar.zst
mkdir -p /opt/wastebin
mv wastebin /opt/wastebin/
chmod +x /opt/wastebin/wastebin
msg_ok "Installed Wastebin"
msg_info "Creating Service"
@ -48,9 +38,8 @@ Description=Start Wastebin Service
After=network.target
[Service]
User=root
WorkingDirectory=/opt/wastebin
ExecStart=/root/.cargo/bin/cargo run --release --quiet
ExecStart=/opt/wastebin/wastebin
[Install]
WantedBy=multi-user.target