Unraid Guide - Advanced - Seedbox setup

advanced
guide
unraid
#1

My script to handle seedbox support using Syncthing on both ends

#!/bin/bash

#if I have a rar, I need to unzip, otherwise move contents to finished/filename
#custom1 is my label

ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"

exec > "${HOME}/process.log"

LABEL1="tvsonarr"
LABEL2="radarr"

if [ "$ARG_LABEL" = "$LABEL1" ] || [ "$ARG_LABEL" = "$LABEL2" ]; then
	if [[ -d "$ARG_PATH" ]]; then
		cd "$ARG_PATH"
		mkdir -p "${HOME}/sync/${3}/${2}/"
		folder=$_
		#unzip
		if ( ls | grep .rar ); then
			rar_file=$(ls | grep .rar)
			unrar e "${rar_file}" "$folder"
		else
			cp -al "$ARG_PATH/." "$folder"
		fi
	else
		#cd to containing folder
		cd $( dirname $ARG_PATH)
		result=$ARG_NAME

		mkdir -p "${HOME}/sync/${3}/"
		folder=$_
		cp -al "$result" "$folder"

	fi
fi
#2

will add rtorrent post download config file later