From 9c65be536cd3b2f48e137e2a176ab74ac0049f5e Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Tue, 11 Nov 2014 20:35:39 +0100 Subject: [PATCH] changing relative path to settings, script can be run from anywhere --- updateTransmissionPort.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/updateTransmissionPort.sh b/updateTransmissionPort.sh index 2de2809..0fec580 100755 --- a/updateTransmissionPort.sh +++ b/updateTransmissionPort.sh @@ -7,6 +7,7 @@ username=$(head -1 $PIA_PASSWD_FILE) passwd=$(tail -1 $PIA_PASSWD_FILE) local_vpn_ip=$(ip addr show tun0 | grep inet | awk '{ print $2 }') pia_client_id_file=/etc/transmission-daemon/pia_client_id +transmission_settings_file=/etc/transmission-daemon/settings.json port_assignment_url=https://www.privateinternetaccess.com/vpninfo/port_forward_assignment # @@ -34,7 +35,7 @@ echo "Got new port $new_port from pia" # # Check if transmission remote is set up with authentication -auth_enabled=$(grep 'rpc-authentication-required\"' settings.json | grep -oE 'true|false') +auth_enabled=$(grep 'rpc-authentication-required\"' $transmission_settings_file | grep -oE 'true|false') if [[ "true" = "$auth_enabled" ]] then echo "transmission auth required"