Proxmox/install/wastebin-install.sh

57 lines
1.4 KiB
Bash
Raw Normal View History

2024-03-11 15:59:12 +01:00
#!/usr/bin/env bash
# Copyright (c) 2021-2024 tteck
# Author: tteck
# Co-Author: MickLesk (Canbiz)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
# Source: https://github.com/matze/wastebin
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
2024-03-11 15:59:12 +01:00
msg_ok "Installed Dependencies"
2024-08-04 23:10:38 +02:00
msg_info "Installing Wastebin"
2024-03-11 15:59:12 +01:00
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/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
2024-03-11 15:59:12 +01:00
msg_ok "Installed Wastebin"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/wastebin.service
[Unit]
Description=Start Wastebin Service
After=network.target
[Service]
WorkingDirectory=/opt/wastebin
ExecStart=/opt/wastebin/wastebin
2024-03-11 15:59:12 +01:00
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now wastebin.service
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
2024-05-02 19:26:16 +02:00
$STD apt-get -y autoremove
$STD apt-get -y autoclean
2024-03-11 15:59:12 +01:00
msg_ok "Cleaned"