Need to edit Deluge config files for both Windows and Linux

Latoid

Need to edit Deluge config files for both Windows and Linux

Postby Latoid » Sun Jun 06, 2010 10:13 pm

Hello
I have both Windows XP and Linux Mint 8. I cannot refuse from any of these OS cause some tasks are cosy to execute under Win, others - under Linux.
So, I really need to edit Deluge confs such way to make all my seedings working under both OS. I studied Deluge confs and found out that only 3 files contain pathes, that should be edited:

\deluge\state\torrents.state
\deluge\core.conf
\deluge\gtkui.conf


so, i wrote such script for linux:

Code: Select all

#!/bin/bash
TORRENTSTATE="/home/maxim/.config/deluge/state/torrents.state"
CORECONF="/home/maxim/.config/deluge/core.conf"
GTKUICONF="/home/maxim/.config/deluge/gtkui.conf"

sed -r "s/(\\\){2}/\//g" -i "$TORRENTSTATE" "$CORECONF" "$GTKUICONF"
sed -r "s/C\:/\/media\/ntfs\/c/g" -i "$TORRENTSTATE" "$CORECONF" "$GTKUICONF"
sed -r "s/D\:/\/media\/ntfs\/d/g" -i "$TORRENTSTATE" "$CORECONF" "$GTKUICONF"
sed -r "s/E\:/\/media\/ntfs\/e/g" -i "$TORRENTSTATE" "$CORECONF" "$GTKUICONF"


and such bat-file for windows:

Code: Select all

@echo off
set TORRENTSTATE="%APPDATA%\deluge\state\torrents.state"
set CORECONF="%APPDATA%\deluge\core.conf"
set GTKUICONF="%APPDATA%\deluge\gtkui.conf"

sed -r "s/\/media\/ntfs\/c/C\:/g" -i "%TORRENTSTATE%" "%CORECONF%" "%GTKUICONF%"
sed -r "s/\/media\/ntfs\/d/D\:/g" -i "%TORRENTSTATE%" "%CORECONF%" "%GTKUICONF%"
sed -r "s/\/media\/ntfs\/e/E\:/g" -i "%TORRENTSTATE%" "%CORECONF%" "%GTKUICONF%"
sed -r "/(C|D|E)\:/s/\//\\\\/g" -i "%TORRENTSTATE%" "%CORECONF%" "%GTKUICONF%"


and created symlink in Mint /home/maxim/.config/deluge -> /media/ntfs/c/Documents and Settings/Admin/Application Data/deluge

These scripts are placed into autoload in both OS and work fine - edit the pathes in that files.
That works nice for Mint - any seedings created in Windows are picked up in Linux with no problems
But, when i start Windows, Deluge doesn't pick up seeding created in Linux

Deluge version - 1.2.3 in both OS

Can you help me with this?

Sorry if any lack of understanding occur - English is not my native

johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Need to edit Deluge config files for both Windows and Li

Postby johnnyg » Mon Jun 07, 2010 3:43 am

I don't think sed exists in windows.

Try the following google search: http://www.google.com.au/search?q=batch ... place+text

Latoid

Re: Need to edit Deluge config files for both Windows and Li

Postby Latoid » Mon Jun 07, 2010 9:45 am

johnnyg wrote:I don't think sed exists in windows.

Try the following google search: http://www.google.com.au/search?q=batch ... place+text


There is sed for windows. I downloaded it from this page http://gnuwin32.sourceforge.net/packages/sed.htm
It works fine - edits necessary files. The problem is not in sed.

mr_kazoodle
New User
New User
Posts: 9
Joined: Thu Jul 01, 2010 5:08 pm

Re: Need to edit Deluge config files for both Windows and Li

Postby mr_kazoodle » Fri Jul 02, 2010 11:38 am

what would happen if you wrote another script for linux, which is executed when at shutdown, instead of the windows batch file?


Return to “Off-topic Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests