Last active
March 12, 2018 03:54
-
-
Save jaikumarm/ca6e346196494a580d7fa28ebe081efc to your computer and use it in GitHub Desktop.
post download auto unrar script for transmission
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"script-torrent-done-enabled": true, | |
"script-torrent-done-filename": "/path/to/transmission_unrar.sh", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Checking $TR_TORRENT_DIR/" >> ~/Downloads/unrar_torrent.log | |
echo "Checking $TR_TORRENT_NAME" >> ~/Downloads/unrar_torrent.log | |
cd $TR_TORRENT_DIR | |
# if torrent has directory | |
if [ -d "$TR_TORRENT_NAME" ] | |
then | |
# check if directory has rar files | |
if ls "$TR_TORRENT_NAME"/*.rar > /dev/null 2>&1 | |
then | |
# find rar file | |
find "$TR_TORRENT_NAME" -iname "*.rar" | while read file | |
do | |
# unrar the file to same location | |
#echo "$file" >> ~/Downloads/unrar_torrent.log | |
/usr/local/bin/unrar x "$file" "$TR_TORRENT_NAME" | |
echo "Unrarred $TR_TORRENT_DIR/$file" >> ~/Downloads/unrar_torrent.log | |
done | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment