add torrserver scripts

This commit is contained in:
Roman Gogolev 2023-09-26 16:59:36 +03:00
parent 4ea0298644
commit 153d1b33d9
3 changed files with 135 additions and 1 deletions

84
ct/alpine-torrserver.sh Normal file
View File

@ -0,0 +1,84 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
# Copyright (c) 2021-2023 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-TorrServer"
var_disk="1"
var_cpu="1"
var_ram="256"
var_os="alpine"
var_version="125"
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=""
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 1 \
"1" "Check for Alpine Updates" 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
exit
;;
esac
done
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8090${CL} \n"

View File

@ -0,0 +1,50 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2023 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
msg_ok "Installed Dependencies"
msg_info "Creating User"
$STD adduser -D -h /opt/torrserver torrserver
msg_info "Donwloading TorrServer"
$STD curl -sL https://github.com/YouROK/TorrServer/releases/download/MatriX.125/TorrServer-linux-amd64 -o /opt/torrserver/TorrServer-linux-amd64
$STD chmod a+x /opt/torrserver/TorrServer-linux-amd64
msg_info "Donwloaded TorrServer"
msg_info "Creating Service"
cat <<EOF >/etc/init.d/torrserver
#!/sbin/openrc-run
name="busybox $RC_SVCNAME"
command="/opt/torrserver/TorrServer-linux-amd64"
command_args="--port 8090 --logpath /var/log/torrserver.log --path /opt/torrserver"
command_user="torrserver:torrserver"
pidfile="/run/$SVCNAME.pid"
command_background=true
depend() {
need net
}
EOF
$STD chmod a+x /etc/init.d/torrserver
$STD rc-update add torrserver
msg_info "Created Service"
motd_ssh
customize

View File

@ -554,7 +554,7 @@ EOF
sleep 2 sleep 2
pct exec "$CTID" -- ash -c "apk add bash >/dev/null" pct exec "$CTID" -- ash -c "apk add bash >/dev/null"
fi fi
lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/install/$var_install.sh)" || exit lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/romka777/Proxmox/main/install/$var_install.sh)" || exit
} }