Alpine recyclarr lxc scripts

This commit is contained in:
Jake Waffle 2024-05-22 18:06:08 -06:00
parent d468fc6c1f
commit 0fef6c3b31
4 changed files with 154 additions and 3 deletions

93
ct/alpine-recyclarr.sh Normal file
View file

@ -0,0 +1,93 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/jawaff/Proxmox/main/misc/build.func)
# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
____ __
/ __ \___ _______ _______/ /___ ___________
/ /_/ / _ \/ ___/ / / / ___/ / __ `/ ___/ ___/
/ _, _/ __/ /__/ /_/ / /__/ / /_/ / / / /
/_/ |_|\___/\___/\__, /\___/_/\__,_/_/ /_/
/____/
Alpine
EOF
}
header_info
echo -e "Loading..."
APP="Alpine-Recyclarr"
var_disk="0.3"
var_cpu="1"
var_ram="256"
var_os="alpine"
var_version="3.19"
var_recyclarr_url="https://github.com/recyclarr/recyclarr/releases/latest/download/recyclarr-linux-x64.tar.xz"
var_config_file="/opt/recyclarr/recyclarr.yml"
var_recyclarr_cron_path="/etc/periodic/daily/recyclarr"
variables
color
catch_errors
function default_settings() {
CT_TYPE="1"
PW=""
CT_ID=$NEXTID
HN=$NSAPP
DISK_SIZE="$var_disk"
CORE_COUNT="$var_cpu"
RAM_SIZE="$var_ram"
BRG="vmbr0"
NET="dhcp"
GATE=""
APT_CACHER=""
APT_CACHER_IP=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}
function update_script() {
if ! apk -e info newt >/dev/null 2>&1; then
apk add -q newt
fi
while true; do
CHOICE=$(
whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --menu "Select option" 11 58 2 \
"1" "Update Recyclarr" \
3>&2 2>&1 1>&3
)
exit_status=$?
if [ $exit_status == 1 ]; then
clear
exit-script
fi
header_info
case $CHOICE in
1)
apk update && apk upgrade
curl -s -L "$var_recyclarr_url" | tar xJ --overwrite -C /usr/local/bin
exit
;;
esac
done
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "Please update ${APP} configuration at ${var_config_file}.\n
Then run ${var_recyclarr_cron_path} for immediate sync or wait until tomorrow for the sync to complete.\n"

View file

@ -0,0 +1,58 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apk add newt
$STD apk add curl
$STD apk add openssh
$STD apk add nano
$STD apk add mc
$STD apk add bash
$STD apk add tzdata
$STD apk add supercronic
$STD apk add git
$STD apk add tini
msg_ok "Installed Dependencies"
var_recyclarr_url="https://github.com/recyclarr/recyclarr/releases/latest/download/recyclarr-linux-x64.tar.xz"
var_config="/opt/recyclarr"
var_recyclarr_cron_path="/etc/periodic/daily/recyclarr"
msg_info "Installing Alpine-Recyclarr"
curl -s -L "$var_recyclarr_url" | tar xJ --overwrite -C /usr/local/bin
msg_ok "Installed Alpine-Recyclarr"
msg_info "Creating Alpine-Recyclarr Config at $var_config"
mkdir -p "$var_config"
recyclarr config create --path "$var_config/recyclarr.yml"
msg_info "Created Alpine-Recyclarr Config at $var_config"
msg_info "Scheduling Alpine-Recyclarr in $var_recyclarr_cron_path"
cat <<EOF >$var_recyclarr_cron_path
#!/usr/bin/env bash
echo
echo "-------------------------------------------------------------"
echo " Executing Tasks: $(date)"
echo "-------------------------------------------------------------"
PATH="\${PATH}:/app/recyclarr"
RECYCLARR_APP_DATA=$var_config
COMPlus_EnableDiagnostics=0
recyclarr sync
EOF
msg_info "Scheduled Alpine-Recyclarr in $var_recyclarr_cron_path"
motd_ssh
customize

View file

@ -531,9 +531,9 @@ build_container() {
TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null
if [ "$var_os" == "alpine" ]; then
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/alpine-install.func)"
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/jawaff/Proxmox/main/misc/alpine-install.func)"
else
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/install.func)"
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/jawaff/Proxmox/main/misc/install.func)"
fi
export CACHER="$APT_CACHER"
export CACHER_IP="$APT_CACHER_IP"

View file

@ -194,6 +194,6 @@ EOF
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
msg_ok "Customized Container"
fi
echo "bash -c \"\$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/${app}.sh)\"" >/usr/bin/update
echo "bash -c \"\$(wget -qLO - https://github.com/jawaff/Proxmox/raw/main/ct/${app}.sh)\"" >/usr/bin/update
chmod +x /usr/bin/update
}