Author Topic: utserver (uTorrent) Plugin for unRaid 5.0  (Read 32096 times)

Offline p4xel

  • Member
  • **
  • Posts: 46
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #30 on: June 17, 2012, 11:06:45 AM »
To check for the latest version you could always do it the down and dirty way:

Code: [Select]
wget http://www.utorrent.com/downloads/linux
newver="$(cat linux | grep maindownloadtitle | awk -F'[()]' '{print $2}')"
rm linux

That currently prints "3.0 build 27079"

You'd have to re-write parts of your plugin to make them dynamic, since right now your download links are all hardcoded. This would probably be hard to do until they release another version so you can see if their naming structure will stay the same. As it is now it'd be kind of a pain, since the file name is utorrent-server-3.0-ubuntu-10.10-27079.tar.gz, throwing the ubuntu in there seems kind of pointless as they don't have a build for any other distro, if they would have named it "utorrent-server-3.0-27079.tar.gz" it would be much simpler.[/code]
To get download link I could use:
Code: [Select]
DOWNLOAD_URL="$(cat linux | grep client-stable-linux-ut | awk -F"['']" '{print $4}')"
That could work. I could refactor the code to make download link dynamic.
There is still one problem - first time I wrote the plugin it worked fine for me but wouldn't for LMon. He mentined a typo in the directory name "utorrent-server-3_0", which I had as "utorrent-server-3.0". Now I can see what was the problem - they have changed the file since I wrote a plugin, and added new WebUI, also changed the directory name. How can I get the directory name after extracting the tar.gz file?

Offline Influencer

  • Hero Member
  • *****
  • Posts: 2041
  • Getting More Awesome
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #31 on: June 17, 2012, 11:59:47 AM »
I'll need you to elaborate more in what you want...

What dir name are you trying to get?

Sent from my HTC Vivid
Always WORKING plugins
Influencers Github:
Get 'Em Here!

Support given HERE!

Info about the Newznab plugin? See the thread!

Offline p4xel

  • Member
  • **
  • Posts: 46
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #32 on: June 17, 2012, 12:08:31 PM »
Sorry for not being clear. I mean the directory name created when extracting .tar.gz file.

Offline LMon

  • Member
  • **
  • Posts: 13
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #33 on: June 17, 2012, 05:23:05 PM »
Sorry, I haven't had any time to work on this.

When I got the plugin originally, the dynamic installer download had been commented out and the current version had been hardcoded in. But the directory for the cp command did not match the one created by the tar command, nor the the one used for the rm command two lines later.

I took a go at trying to make it not rely on filenames at all. It's probably not that elegant or efficient but I think it works (I tried it all manually, I'm not able to fully test it out at the moment)

Code: [Select]
# Check for latest version
# Change to temp directory
cd /tmp
# Retrieve download page to file "page"
wget -q -O page http://www.utorrent.com/downloads/complete?os=lin&track=stable
# Extract download URL and store in $stable
stable=($(grep -o http://[^[:space:]]*.tar.gz page | head -1))
# Remove temporary file
rm page

# Create temporary directory to download and extract files in
mkdir /tmp/utinstall
cd /tmp/utinstall
# Download utserver and untar
curl -s $stable | tar -xz
# Get directory that files have been untared to and copy to $INSTALLDIR
cp -R `find /tmp/utinstall -name utserver -printf %h`/* $INSTALLDIR
chown -R $RUNAS:users "$INSTALLDIR"
# Remove temporary files
rm -R /tmp/utinstall
« Last Edit: June 17, 2012, 05:31:04 PM by LMon »

Offline Influencer

  • Hero Member
  • *****
  • Posts: 2041
  • Getting More Awesome
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #34 on: June 17, 2012, 07:01:46 PM »
That looks like it'd work fine, and solves p4xels issue of finding the directory name
Always WORKING plugins
Influencers Github:
Get 'Em Here!

Support given HERE!

Info about the Newznab plugin? See the thread!

Offline LMon

  • Member
  • **
  • Posts: 13
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #35 on: June 17, 2012, 10:26:02 PM »
P4xel, I use the webui found here. I think it's a bit better than the default, but still not as good as the native windows interface. Importantly for me, it allows you to assign labels and use rss feeds.

Offline p4xel

  • Member
  • **
  • Posts: 46
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #36 on: June 17, 2012, 11:01:43 PM »
Good job LMon. If you have some spare time, which I lack at the moment, could you also add and test data_dir variable to utserver.conf to avoid confusion for new users.

Code: [Select]
#Temporary download location:
DIR_ACTIVE:"$Data_dir/.temp/
#Move completed jobs to:
DIR_COMPLETED:"$Data_dir/completed/

The reason I commented out dynamic download is that it wouldn't work most of the times (2 out fo 3) so I hardcoded the url.
Meanwhile they have changed the dir name in .tar.gz file hence the errors you mentioned (that mush have been the moment they changed WebUI but the actual utserver version, build and download url remained unchanged).

Thanks for WebUI link by the way. This is exactly what I was looking for. It looks like enhanced version of older original UI. The new one is a bug disappointment thou.

EDIT:

I updated the plugin already. Check the first post.
Thanks for all suggestions.

p4xel.
« Last Edit: June 19, 2012, 05:37:34 PM by p4xel »

Online thaddeussmith

  • Member
  • **
  • Posts: 39
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #37 on: June 22, 2012, 05:59:30 PM »
why is this install script copying my Pictures share to the app_cache install directory?

Offline Influencer

  • Hero Member
  • *****
  • Posts: 2041
  • Getting More Awesome
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #38 on: June 22, 2012, 06:11:26 PM »
is the name of the share pictures?
Always WORKING plugins
Influencers Github:
Get 'Em Here!

Support given HERE!

Info about the Newznab plugin? See the thread!

Online thaddeussmith

  • Member
  • **
  • Posts: 39
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #39 on: June 22, 2012, 06:14:09 PM »
yep.. my paths are:

/mnt/user/Pictures

/mnt/user/app_cache/utserver

why does that matter? or rather, why is it going to try and copy all 130GB before starting the app so i can disable or change such settings?

Online thaddeussmith

  • Member
  • **
  • Posts: 39
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #40 on: June 22, 2012, 06:25:31 PM »
update: it's copying my entire unraid system tree. renamed "Pictures" to "Images" and restarted the process, went through and copied the system folders and began to copy my "Music" share.

http://cl.ly/1H0r192s1e2r1O3K3g1H

Offline p4xel

  • Member
  • **
  • Posts: 46
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #41 on: June 22, 2012, 10:52:07 PM »
it must be a glitch with this line
Code: [Select]
# Get directory that files have been untared to and copy to $INSTALLDIR
cp -R `find /tmp/utinstall -name utserver -printf %h`/* $INSTALLDIR
What directories have you set up in settings page for utserver?

EDIT: Strange... I tested it again on my box and everything seems to be fine. Show me what is in your /tmp/utinstall
« Last Edit: June 22, 2012, 11:00:45 PM by p4xel »

Offline zolle76

  • Member
  • **
  • Posts: 39
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #42 on: June 23, 2012, 12:07:25 AM »
update: it's copying my entire unraid system tree. renamed "Pictures" to "Images" and restarted the process, went through and copied the system folders and began to copy my "Music" share.

http://cl.ly/1H0r192s1e2r1O3K3g1H

Same happened to me, but recursively. There was my whole / in the utserver folder, one level below again and so on..
HP ProLiant N36L Microserver | 5 GB RAM | 3x WD20EARS 1x Seagate 250 GB as Cache | unRAID Plus 5b14
HP ProLiant N40L Microserver | 2 GB RAM | 1x WD20EARX 1x WD20EADS | unRaid Basic 5 RC4

Offline p4xel

  • Member
  • **
  • Posts: 46
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #43 on: June 23, 2012, 12:29:22 AM »
It appears to be more serious than I thought. I need to rewrite the installation part to be safer in case of unexpected behaviour.

Online thaddeussmith

  • Member
  • **
  • Posts: 39
Re: utserver (uTorrent) Plugin for unRaid 5.0 rc3
« Reply #44 on: June 23, 2012, 06:15:24 AM »
it must be a glitch with this line
Code: [Select]
# Get directory that files have been untared to and copy to $INSTALLDIR
cp -R `find /tmp/utinstall -name utserver -printf %h`/* $INSTALLDIR
What directories have you set up in settings page for utserver?

EDIT: Strange... I tested it again on my box and everything seems to be fine. Show me what is in your /tmp/utinstall

sorry - it wouldn't stop copying media so i blasted the plugin and restarted the server. i'll happily test again when you're ready.