How to include some settings (ratio.dat/ratiorules.dat) in default created user files?

I have some settings files (ratio.dat and ratiorules.dat) which I want to include in each user created. I can manually place them in rutorrent/share/users/username/settings folder after creating user but I’m looking for a way have them automatically put there when user is created.

On a previous script setup I modified a rutorrent archive and included the files in rutorrent/share/settings and then each user created would have these settings. I’ve tried placing the files in the rutorrent/share/settings folder but they do not get used.

Is there anything I can modify/add to etc on Quickbox setup so similar can be achieved?

1 Like

maybe create a local copy of bash.rc and include your setting when using command createseedboxuser?

From line 1115 - function createSeedboxUser() {

1 Like

Thanks but the ratio.dat/ratiorules.dat can’t be included in an rc file as far as I’m aware or not sure how to integrate into the bash?

Stash them in a dir somewhere…Like /root/ratio.
Add a line in roots .Bashrc add seedbox user section to copy them in place at the end of that section and then chown/chmod them appropriately.

1 Like

goto like line 1528 of roots .bashrc and add some lines similar to this…I havent tested them.

cp /root/ratio/* /srv/rutorrent/share/users/$username/settings/
chown $username /srv/rutorrent/share/users/$username/settings/ratio*
chmod 775 /srv/rutorrent/share/users/$username/settings/ratio*
1 Like

exactly what I had in mind

Thanks guys, I’ll have a try later and report back. Much apprciated :slight_smile:

Setting up modern file-system indexer (h5ai) for test1 … cp: target ‘/srv/rutorrent/share/users/test1/settings/’ is not a directory
chown: cannot access ‘/srv/rutorrent/share/users/test1/settings/ratio*’: No such file or directory
chmod: cannot access ‘/srv/rutorrent/share/users/test1/settings/ratio*’: No such file or directory

ok…you’re going to need to do some legwork yourself to find the correct directory or why its not created by that point. I’ve given you as much as I’m going to give you…the rest is on you.

The settings directories are not created until you first load ruTorrent so unfortunately the lines of code won’t work when creating user. :frowning:

Would you know how to create directory before moving the files?