Help modifying peer-port variable on boot

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
avk000
Posts: 1
Joined: Tue Jul 09, 2019 12:51 pm

Help modifying peer-port variable on boot

Post by avk000 » Tue Jul 09, 2019 1:29 pm

Hello community,

I want to update the settings.json file every time the machine boots, and before transmission-daemon starts. More specifically, the peer-port variable. I want the new value to be read from a plain text file. Is this possible? How?

My Setup
  • Raspberry Pi 3b+
  • Raspbian Buster
  • transmission-daemon & transmision web interface
  • Private Internet Access on openvpn client.
  • settings.json location:

    Code: Select all

    /home/transmission/.settings/transmission-daemon/settings.json 
  • file with desired value:

    Code: Select all

    /home/pi/Documents/forwardedport.txt 

Currently, transmission-daemon is set to start on boot by the user transmission's crontab. This is the relevant line.

Code: Select all

@reboot transmission-daemon
forwardedport.txt looks like this

Code: Select all

Loading port forward assignment information...
{"port":56439}
The reason for this is to give transmission a forwarded port that is allocated by PIA on re-connection. For this purpose I am executing PIA's port_forwarding.sh script at boot from root's crontab, and printing its output to the forwardedport.txt file.
This is the relevant line.

Code: Select all

@reboot sleep 75 && /etc/openvpn/port_forwarding.sh > /home/pi/Documents/forwardedport.txt
I am not very knowledgeable about linux systems so any help is genuinely appreciated.

regards,

avk000

Post Reply