move torrent scripts and revise torrentcomplete

This commit is contained in:
Lucas Faber committed 2026-09-25 11:57:47 +02:00
1 parent 8d9a32879b
commit fcb901e64d
6 files changed
+3 -103

No files matched your search

-24
View File
@@ -1,24 +0,0 @@
#!/bin/bash
PW=$(cat /home/lucas/.PW)
FOLDER=/torrent/magnets/
nextcloudcmd --trust --user lucas --password ${PW} --path Dokumente/Dokumente/Shared/Magnets ${FOLDER} https://localhost 1>/dev/null 2>&1
filename="${FOLDER}Magnets.md"
while IFS= read -r line
do
sudo /home/lucas/scripts/serverhost/deluge_user_cmd.sh deluge-console "connect 127.0.0.1:58846; add ${line}" 1>/dev/null 2>&1
done < "${filename}"
> ${filename}
FILES="${FOLDER}*.torrent"
if [ -f ${FILES} ]; then
for file in $FILES
do
echo "Processing ${file} file..."
cat "${file}"
rm "${file}"
done
fi
nextcloudcmd --trust --user lucas --password ${PW} --path Dokumente/Dokumente/Shared/Magnets ${FOLDER} https://localhost 1>/dev/null 2>&1
-2
View File
@@ -1,2 +0,0 @@
#!/bin/bash
chown -R lucas:lucas "$@"
-75
View File
@@ -1,75 +0,0 @@
#!/bin/bash
duser="sudo /home/lucas/scripts/deluge_user_cmd.sh"
FILE_PATH="/torrent/complete/"
STUFF="/home/lucas/Documents/Dokumente/Projekte/Server/Transfer/"
ASSUMEYES=false
usage() {
printf "Usage:
-y\ty Mode
-m\tMega Mode
-help\tDisplay this\n"
}
get_config() {
while [[ ${1:0:1} == - ]]; do
echo "Param: $1"
[[ $1 == -help ]] && {
echo "Help true"
usage;
exit;
};
[[ $1 == -y ]] && {
echo "y Mode"
ASSUMEYES=true
shift 1
continue
};
echo "Parameter $1 discarded"
usage
exit
done
}
get_config "$@"
syncNC
IFS=$'\n'; set -f
LIST=($(ls ${FILE_PATH}))
if [ ${#LIST[@]} -eq 0 ]; then
echo "Nothing to Copy/Delete"
exit
fi
if [ "${ASSUMEYES}" == "false" ]; then
echo "Copy? (y/*)"
echo "${LIST[@]}"
read -n 10 ans
else
ans="y"
fi
fail=false
if [ "$ans" == "y" ]; then
for files in ${LIST[@]}; do
cp -r ${FILE_PATH}${files} ${STUFF}
if [ $? -ne 0 ]; then fail=true; echo "Copy Failure"; exit; fi
chmod 777 -R ${STUFF}${files}
done
printf "Torrents Copied\n"
else
printf "Nothing Copied\n"
fi
if [ "${ASSUMEYES}" == "false" ]; then
echo "Delete? (y/*)"
echo "${LIST[*]}"
read -n 10 ans
else
ans="y"
fi
if [ "$ans" == "y" ]; then
for files in ${LIST[@]}; do
echo "Delete $files"
sudo /home/lucas/scripts/deluge_user_cmd.sh rm -dr ${FILE_PATH}${files}
done
printf "Torrents Removed\n"
else
printf "Nothing Removed\n"
fi
syncNC >> /dev/null 2>&1
File renamed without changes.
@@ -1,3 +1,4 @@
#!/home/lucas/scripts/.venv/bin/python
import sys import sys
import paho.mqtt.client as mqtt import paho.mqtt.client as mqtt
@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
#deluge-console "connect 127.0.0.1:58846; rm $1 -c" 2>/dev/null
echo "$@" >> /home/lucas/.LOG/log_torrentlog.txt echo "$@" >> /home/lucas/.LOG/log_torrentlog.txt
/home/lucas/mqqt_venv/bin/python /home/lucas/scripts/serverhost/torrent_mqtt.py "$*" /home/lucas/scripts/serverhost/torrent_mqtt.py "$*"
#sudo mail -s 'Torr Completed' lucas-f@live.at <<< "Finished at : $(date)" #sudo mail -s 'Torr Completed' lucas-f@live.at <<< "Finished at : $(date)"