feat(docker_compose): mediahost nfs, update backup for py,remove old copy torrent_complete scripts
This commit is contained in:
1 parent
f10157792c
commit
1ca2eab855
6 files changed
+10
-587
No files matched your search
@@ -1,8 +1,5 @@
|
||||
#!/bin/bash
|
||||
cd /docker
|
||||
find . -maxdepth 3 -type f \
|
||||
\( -name "*.yaml" -o -name "*.yml" -o -name "*.conf" -o -name "*.sh" \) \
|
||||
-print0 2>/dev/null |
|
||||
|
||||
rsync -aR --files-from=- --from0 ./ /home/lucas/scripts/docker_compose/$(hostname)
|
||||
find . -maxdepth 3 -type f \( -name "*.yaml" -o -name "*.yml" -o -name "*.conf" -o -name "*.sh" -o -name "*.py" \) \
|
||||
-print0 2>/dev/null | rsync -aR --files-from=- --from0 ./ /home/lucas/scripts/docker_compose/$(hostname)
|
||||
crontab -l > /home/lucas/scripts/docker_compose/$(hostname)/crontab.bak
|
||||
@@ -1,193 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
###############################################################################
|
||||
# Description:
|
||||
# qBittorrent external script that:
|
||||
# 1. Receives torrent name, root path and category from qBittorrent.
|
||||
# 2. Sends the torrent name to torrent_mqtt.py.
|
||||
# 3. Copies the torrent contents to mediahost via SCP.
|
||||
# 4. Logs all output to a timestamped logfile.
|
||||
#
|
||||
# Usage:
|
||||
# torrent_complete.sh <torrent_name> <root_path> <category>
|
||||
#
|
||||
# qBittorrent configuration:
|
||||
# /home/lucas/scripts/serverhost/torrent_complete.sh "%N" "%R" "%L"
|
||||
#
|
||||
# Arguments:
|
||||
# $1 Torrent name
|
||||
# $2 Root path
|
||||
# $3 Torrent category
|
||||
#
|
||||
# Log files:
|
||||
# /home/lucas/.LOG/log_torrent_name_YYYY-MM-DD_HH-MM-SS.log
|
||||
#
|
||||
# Requirements:
|
||||
# - bash
|
||||
# - scp
|
||||
# - SSH access to "mediahost"
|
||||
# - /home/lucas/scripts/serverhost/torrent_mqtt.py
|
||||
###############################################################################
|
||||
|
||||
set -u
|
||||
|
||||
SCRIPT_NAME="$(basename "$0")"
|
||||
|
||||
###############################################################################
|
||||
# Usage
|
||||
###############################################################################
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage:
|
||||
$SCRIPT_NAME <torrent_name> <root_path> <category>
|
||||
|
||||
Description:
|
||||
Sends the torrent name to torrent_mqtt.py and copies the torrent
|
||||
contents to mediahost.
|
||||
|
||||
Arguments:
|
||||
torrent_name Torrent name
|
||||
root_path Torrent root path
|
||||
category Torrent category
|
||||
|
||||
Example:
|
||||
$SCRIPT_NAME "Ubuntu 24.04" "/downloads/Ubuntu 24.04" "Linux"
|
||||
|
||||
qBittorrent:
|
||||
$SCRIPT_NAME "%N" "%R" "%L"
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Check arguments
|
||||
###############################################################################
|
||||
|
||||
if [[ $# -ne 3 ]]; then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TORRENT_NAME="$1"
|
||||
ROOT_PATH="$2"
|
||||
CATEGORY="$3"
|
||||
if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
||||
|
||||
###############################################################################
|
||||
# Start
|
||||
###############################################################################
|
||||
|
||||
echo "=================================================="
|
||||
echo "Torrent transfer started"
|
||||
echo "Date: $(date)"
|
||||
echo "Script: $SCRIPT_NAME"
|
||||
echo "Torrent name: $TORRENT_NAME"
|
||||
echo "Root path: $ROOT_PATH"
|
||||
echo "Category: $CATEGORY"
|
||||
echo "=================================================="
|
||||
|
||||
###############################################################################
|
||||
# Check for scp command
|
||||
###############################################################################
|
||||
|
||||
if ! command -v scp >/dev/null 2>&1; then
|
||||
echo "Install scp"
|
||||
sed -i 's|http://|https://|g' /etc/apk/repositories
|
||||
for i in {1..12}; do
|
||||
if apk add --no-cache openssh-client; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Retry $i/12"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Send torrent name to MQTT script
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "--- Sending torrent name to torrent_mqtt.py ---"
|
||||
|
||||
/config/.venv/bin/python3 /config/torrent_mqtt.py "$TORRENT_NAME"
|
||||
|
||||
MQTT_STATUS=$?
|
||||
|
||||
echo "torrent_mqtt.py exit status: $MQTT_STATUS"
|
||||
|
||||
###############################################################################
|
||||
# Check root path
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "--- Checking root path ---"
|
||||
|
||||
if [[ ! -d "$ROOT_PATH" ]]; then
|
||||
echo "ERROR: Root path does not exist or is not a directory:"
|
||||
echo " $ROOT_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Root path exists."
|
||||
|
||||
###############################################################################
|
||||
# Copy torrent to mediahost
|
||||
###############################################################################
|
||||
|
||||
basename_root=$(basename "$ROOT_PATH")
|
||||
echo $basename_root
|
||||
if [ "$basename_root" = "downloads" ]; then
|
||||
remote_dir="$TORRENT_NAME"
|
||||
else
|
||||
remote_dir="$basename_root"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "--- Copying torrent to mediahost ---"
|
||||
echo "Source: $ROOT_PATH"
|
||||
echo "Destination: mediahost:/torrent/qbittorrent/mediahost/"
|
||||
|
||||
ssh -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
lucas@mediahost "mkdir -p \"/torrent/qbittorrent/mediahost/$remote_dir\""
|
||||
SSH_STATUS=$?
|
||||
scp -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
-r "$ROOT_PATH"/. lucas@mediahost:/torrent/qbittorrent/mediahost/$remote_dir/
|
||||
SCP_STATUS=$?
|
||||
|
||||
echo "scp exit status: $SCP_STATUS"
|
||||
|
||||
###############################################################################
|
||||
# Result
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "=================================================="
|
||||
|
||||
if [[ $MQTT_STATUS -ne 0 ]]; then
|
||||
echo "WARNING: torrent_mqtt.py failed."
|
||||
fi
|
||||
if [[ $SSH_STATUS -eq 0 ]]; then
|
||||
echo "Target Dir generated"
|
||||
else
|
||||
echo "ERROR: Target dir generation failed."
|
||||
fi
|
||||
|
||||
if [[ $SCP_STATUS -eq 0 ]]; then
|
||||
echo "Torrent transfer completed successfully."
|
||||
else
|
||||
echo "ERROR: Torrent transfer failed."
|
||||
fi
|
||||
|
||||
echo "Finished: $(date +'%y%m%d %H%M%Sr')"
|
||||
echo "=================================================="
|
||||
else
|
||||
echo "ARR handled torrent: $(date +'%y%m%d %H%M%S'): $TORRENT_NAME"
|
||||
fi
|
||||
|
||||
# Return SCP's exit status to qBittorrent
|
||||
exit 0
|
||||
|
||||
@@ -7,6 +7,7 @@ services:
|
||||
- TZ=Europe/Vienna
|
||||
- PUID=1000
|
||||
- WEBUI_PORT=8080
|
||||
- WEBUI_NAME=qBittorrent-Private
|
||||
ports:
|
||||
- "8080:8080/tcp"
|
||||
- "55661:55661/udp"
|
||||
@@ -15,9 +16,11 @@ services:
|
||||
volumes:
|
||||
- "./10-torrent-init.sh:/custom-cont-init.d/10-torrent-init.sh:ro"
|
||||
- "./qbittorrent-private:/config"
|
||||
- "./qbittorrent-scripts:/scripts"
|
||||
- "/home/lucas/scripts/torrent:/hostscripts:ro"
|
||||
- "/torrent/qbittorrent-private/downloads:/downloads-private"
|
||||
- "/torrent/qbittorrent-private/torrents:/torrents"
|
||||
- "/torrent/qbittorrent/mediahost:/mediahost"
|
||||
qbittorrent-public:
|
||||
# image: "lscr.io/linuxserver/qbittorrent:latest"
|
||||
build: qbittorrent-public/
|
||||
@@ -27,6 +30,7 @@ services:
|
||||
- TZ=Europe/Vienna
|
||||
- PUID=1000
|
||||
- WEBUI_PORT=8080
|
||||
- WEBUI_NAME=qBittorrent-Public
|
||||
network_mode: "service:gluetun"
|
||||
depends_on:
|
||||
- gluetun
|
||||
@@ -38,11 +42,12 @@ services:
|
||||
volumes:
|
||||
- "./10-torrent-init.sh:/custom-cont-init.d/10-torrent-init.sh:ro"
|
||||
- "./qbittorrent-public:/config"
|
||||
- "./qbittorrent-scripts:/scripts"
|
||||
- "/home/lucas/scripts/torrent:/hostscripts:ro"
|
||||
- "/torrent/qbittorrent-public/downloads:/downloads-public"
|
||||
- "/torrent/qbittorrent-public/buffer:/downloads-private"
|
||||
- "/torrent/qbittorrent-public/torrents:/torrents"
|
||||
- "/data/torrent:/downloads-special"
|
||||
- "/torrent/qbittorrent/mediahost:/mediahost"
|
||||
gluetun:
|
||||
image: qmcgaw/gluetun:latest
|
||||
container_name: gluetun
|
||||
|
||||
@@ -6,6 +6,6 @@ Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = zPg3ZJ7OsztQ0CRSSvH5o2KVL1DYgDGW65DFwLsYwyw=
|
||||
PublicKey = z2Ik8BG6XgosyYE/O4Vz4kiPTZyoWSlJvZtFeFlNclI=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = 92.62.123.85:51820
|
||||
Endpoint = 62.197.146.17:51820
|
||||
-193
@@ -1,193 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
###############################################################################
|
||||
# Description:
|
||||
# qBittorrent external script that:
|
||||
# 1. Receives torrent name, root path and category from qBittorrent.
|
||||
# 2. Sends the torrent name to torrent_mqtt.py.
|
||||
# 3. Copies the torrent contents to mediahost via SCP.
|
||||
# 4. Logs all output to a timestamped logfile.
|
||||
#
|
||||
# Usage:
|
||||
# torrent_complete.sh <torrent_name> <root_path> <category>
|
||||
#
|
||||
# qBittorrent configuration:
|
||||
# /home/lucas/scripts/serverhost/torrent_complete.sh "%N" "%R" "%L"
|
||||
#
|
||||
# Arguments:
|
||||
# $1 Torrent name
|
||||
# $2 Root path
|
||||
# $3 Torrent category
|
||||
#
|
||||
# Log files:
|
||||
# /home/lucas/.LOG/log_torrent_name_YYYY-MM-DD_HH-MM-SS.log
|
||||
#
|
||||
# Requirements:
|
||||
# - bash
|
||||
# - scp
|
||||
# - SSH access to "mediahost"
|
||||
# - /home/lucas/scripts/serverhost/torrent_mqtt.py
|
||||
###############################################################################
|
||||
|
||||
set -u
|
||||
|
||||
SCRIPT_NAME="$(basename "$0")"
|
||||
|
||||
###############################################################################
|
||||
# Usage
|
||||
###############################################################################
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage:
|
||||
$SCRIPT_NAME <torrent_name> <root_path> <category>
|
||||
|
||||
Description:
|
||||
Sends the torrent name to torrent_mqtt.py and copies the torrent
|
||||
contents to mediahost.
|
||||
|
||||
Arguments:
|
||||
torrent_name Torrent name
|
||||
root_path Torrent root path
|
||||
category Torrent category
|
||||
|
||||
Example:
|
||||
$SCRIPT_NAME "Ubuntu 24.04" "/downloads/Ubuntu 24.04" "Linux"
|
||||
|
||||
qBittorrent:
|
||||
$SCRIPT_NAME "%N" "%R" "%L"
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Check arguments
|
||||
###############################################################################
|
||||
|
||||
if [[ $# -ne 3 ]]; then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TORRENT_NAME="$1"
|
||||
ROOT_PATH="$2"
|
||||
CATEGORY="$3"
|
||||
if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
||||
|
||||
###############################################################################
|
||||
# Start
|
||||
###############################################################################
|
||||
|
||||
echo "=================================================="
|
||||
echo "Torrent transfer started"
|
||||
echo "Date: $(date)"
|
||||
echo "Script: $SCRIPT_NAME"
|
||||
echo "Torrent name: $TORRENT_NAME"
|
||||
echo "Root path: $ROOT_PATH"
|
||||
echo "Category: $CATEGORY"
|
||||
echo "=================================================="
|
||||
|
||||
###############################################################################
|
||||
# Check for scp command
|
||||
###############################################################################
|
||||
|
||||
if ! command -v scp >/dev/null 2>&1; then
|
||||
echo "Install scp"
|
||||
sed -i 's|http://|https://|g' /etc/apk/repositories
|
||||
for i in {1..12}; do
|
||||
if apk add --no-cache openssh-client; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Retry $i/12"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Send torrent name to MQTT script
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "--- Sending torrent name to torrent_mqtt.py ---"
|
||||
|
||||
/config/.venv/bin/python3 /config/torrent_mqtt.py "$TORRENT_NAME"
|
||||
|
||||
MQTT_STATUS=$?
|
||||
|
||||
echo "torrent_mqtt.py exit status: $MQTT_STATUS"
|
||||
|
||||
###############################################################################
|
||||
# Check root path
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "--- Checking root path ---"
|
||||
|
||||
if [[ ! -d "$ROOT_PATH" ]]; then
|
||||
echo "ERROR: Root path does not exist or is not a directory:"
|
||||
echo " $ROOT_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Root path exists."
|
||||
|
||||
###############################################################################
|
||||
# Copy torrent to mediahost
|
||||
###############################################################################
|
||||
|
||||
basename_root=$(basename "$ROOT_PATH")
|
||||
echo $basename_root
|
||||
if [ "$basename_root" = "downloads" ]; then
|
||||
remote_dir="$TORRENT_NAME"
|
||||
else
|
||||
remote_dir="$basename_root"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "--- Copying torrent to mediahost ---"
|
||||
echo "Source: $ROOT_PATH"
|
||||
echo "Destination: mediahost:/torrent/qbittorrent/mediahost/"
|
||||
|
||||
ssh -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
lucas@mediahost "mkdir -p \"/torrent/qbittorrent/mediahost/$remote_dir\""
|
||||
SSH_STATUS=$?
|
||||
scp -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
-r "$ROOT_PATH"/. lucas@mediahost:/torrent/qbittorrent/mediahost/$remote_dir/
|
||||
SCP_STATUS=$?
|
||||
|
||||
echo "scp exit status: $SCP_STATUS"
|
||||
|
||||
###############################################################################
|
||||
# Result
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "=================================================="
|
||||
|
||||
if [[ $MQTT_STATUS -ne 0 ]]; then
|
||||
echo "WARNING: torrent_mqtt.py failed."
|
||||
fi
|
||||
if [[ $SSH_STATUS -eq 0 ]]; then
|
||||
echo "Target Dir generated"
|
||||
else
|
||||
echo "ERROR: Target dir generation failed."
|
||||
fi
|
||||
|
||||
if [[ $SCP_STATUS -eq 0 ]]; then
|
||||
echo "Torrent transfer completed successfully."
|
||||
else
|
||||
echo "ERROR: Torrent transfer failed."
|
||||
fi
|
||||
|
||||
echo "Finished: $(date +'%y%m%d %H%M%Sr')"
|
||||
echo "=================================================="
|
||||
else
|
||||
echo "ARR handled torrent: $(date +'%y%m%d %H%M%S'): $TORRENT_NAME"
|
||||
fi
|
||||
|
||||
# Return SCP's exit status to qBittorrent
|
||||
exit 0
|
||||
|
||||
-193
@@ -1,193 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
###############################################################################
|
||||
# Description:
|
||||
# qBittorrent external script that:
|
||||
# 1. Receives torrent name, root path and category from qBittorrent.
|
||||
# 2. Sends the torrent name to torrent_mqtt.py.
|
||||
# 3. Copies the torrent contents to mediahost via SCP.
|
||||
# 4. Logs all output to a timestamped logfile.
|
||||
#
|
||||
# Usage:
|
||||
# torrent_complete.sh <torrent_name> <root_path> <category>
|
||||
#
|
||||
# qBittorrent configuration:
|
||||
# /home/lucas/scripts/serverhost/torrent_complete.sh "%N" "%R" "%L"
|
||||
#
|
||||
# Arguments:
|
||||
# $1 Torrent name
|
||||
# $2 Root path
|
||||
# $3 Torrent category
|
||||
#
|
||||
# Log files:
|
||||
# /home/lucas/.LOG/log_torrent_name_YYYY-MM-DD_HH-MM-SS.log
|
||||
#
|
||||
# Requirements:
|
||||
# - bash
|
||||
# - scp
|
||||
# - SSH access to "mediahost"
|
||||
# - /home/lucas/scripts/serverhost/torrent_mqtt.py
|
||||
###############################################################################
|
||||
|
||||
set -u
|
||||
|
||||
SCRIPT_NAME="$(basename "$0")"
|
||||
|
||||
###############################################################################
|
||||
# Usage
|
||||
###############################################################################
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage:
|
||||
$SCRIPT_NAME <torrent_name> <root_path> <category>
|
||||
|
||||
Description:
|
||||
Sends the torrent name to torrent_mqtt.py and copies the torrent
|
||||
contents to mediahost.
|
||||
|
||||
Arguments:
|
||||
torrent_name Torrent name
|
||||
root_path Torrent root path
|
||||
category Torrent category
|
||||
|
||||
Example:
|
||||
$SCRIPT_NAME "Ubuntu 24.04" "/downloads/Ubuntu 24.04" "Linux"
|
||||
|
||||
qBittorrent:
|
||||
$SCRIPT_NAME "%N" "%R" "%L"
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Check arguments
|
||||
###############################################################################
|
||||
|
||||
if [[ $# -ne 3 ]]; then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TORRENT_NAME="$1"
|
||||
ROOT_PATH="$2"
|
||||
CATEGORY="$3"
|
||||
if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
||||
|
||||
###############################################################################
|
||||
# Start
|
||||
###############################################################################
|
||||
|
||||
echo "=================================================="
|
||||
echo "Torrent transfer started"
|
||||
echo "Date: $(date)"
|
||||
echo "Script: $SCRIPT_NAME"
|
||||
echo "Torrent name: $TORRENT_NAME"
|
||||
echo "Root path: $ROOT_PATH"
|
||||
echo "Category: $CATEGORY"
|
||||
echo "=================================================="
|
||||
|
||||
###############################################################################
|
||||
# Check for scp command
|
||||
###############################################################################
|
||||
|
||||
if ! command -v scp >/dev/null 2>&1; then
|
||||
echo "Install scp"
|
||||
sed -i 's|http://|https://|g' /etc/apk/repositories
|
||||
for i in {1..12}; do
|
||||
if apk add --no-cache openssh-client; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Retry $i/12"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Send torrent name to MQTT script
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "--- Sending torrent name to torrent_mqtt.py ---"
|
||||
|
||||
/config/.venv/bin/python3 /config/torrent_mqtt.py "$TORRENT_NAME"
|
||||
|
||||
MQTT_STATUS=$?
|
||||
|
||||
echo "torrent_mqtt.py exit status: $MQTT_STATUS"
|
||||
|
||||
###############################################################################
|
||||
# Check root path
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "--- Checking root path ---"
|
||||
|
||||
if [[ ! -d "$ROOT_PATH" ]]; then
|
||||
echo "ERROR: Root path does not exist or is not a directory:"
|
||||
echo " $ROOT_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Root path exists."
|
||||
|
||||
###############################################################################
|
||||
# Copy torrent to mediahost
|
||||
###############################################################################
|
||||
|
||||
basename_root=$(basename "$ROOT_PATH")
|
||||
echo $basename_root
|
||||
if [ "$basename_root" = "downloads" ]; then
|
||||
remote_dir="$TORRENT_NAME"
|
||||
else
|
||||
remote_dir="$basename_root"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "--- Copying torrent to mediahost ---"
|
||||
echo "Source: $ROOT_PATH"
|
||||
echo "Destination: mediahost:/torrent/qbittorrent/mediahost/"
|
||||
|
||||
ssh -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
lucas@mediahost "mkdir -p \"/torrent/qbittorrent/mediahost/$remote_dir\""
|
||||
SSH_STATUS=$?
|
||||
scp -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
-r "$ROOT_PATH"/. lucas@mediahost:/torrent/qbittorrent/mediahost/$remote_dir/
|
||||
SCP_STATUS=$?
|
||||
|
||||
echo "scp exit status: $SCP_STATUS"
|
||||
|
||||
###############################################################################
|
||||
# Result
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "=================================================="
|
||||
|
||||
if [[ $MQTT_STATUS -ne 0 ]]; then
|
||||
echo "WARNING: torrent_mqtt.py failed."
|
||||
fi
|
||||
if [[ $SSH_STATUS -eq 0 ]]; then
|
||||
echo "Target Dir generated"
|
||||
else
|
||||
echo "ERROR: Target dir generation failed."
|
||||
fi
|
||||
|
||||
if [[ $SCP_STATUS -eq 0 ]]; then
|
||||
echo "Torrent transfer completed successfully."
|
||||
else
|
||||
echo "ERROR: Torrent transfer failed."
|
||||
fi
|
||||
|
||||
echo "Finished: $(date +'%y%m%d %H%M%Sr')"
|
||||
echo "=================================================="
|
||||
else
|
||||
echo "ARR handled torrent: $(date +'%y%m%d %H%M%S'): $TORRENT_NAME"
|
||||
fi
|
||||
|
||||
# Return SCP's exit status to qBittorrent
|
||||
exit 0
|
||||
|
||||
Reference in new issue
Block a user