From d21760cc65f6b0f0fa227c042d98c49610500eeb Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 4 Aug 2024 17:07:52 -0400 Subject: [PATCH] Update wastebin-install.sh Refactor Fixes https://github.com/tteck/Proxmox/issues/3465 --- install/wastebin-install.sh | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/install/wastebin-install.sh b/install/wastebin-install.sh index 227b1095..cb7dca71 100644 --- a/install/wastebin-install.sh +++ b/install/wastebin-install.sh @@ -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