Fixed the transmission with your version.
Those are the scripts i use:
to run everything i call (softlinked from /usr/local/etc/init.d/) this, wich is here: /volume1/.@plugins/AppCentral/openvpn/CONTROL/start-stop.sh
Code: Select all
#!/bin/sh
/volume1/.@plugins/AppCentral/openvpn/CONTROL/start.sh &
exit
Not elegant but demonizes what follows, allowing the init.d chain to go on.
It calls /volume1/.@plugins/AppCentral/openvpn/CONTROL/start.sh wich is:
Code: Select all
#!/bin/sh
# filename: /root/openvpn/start.sh
SERVER=vpnserver.ovpn
/etc/script/vpn.sh insmod
while true; do
openvpn --config /share/Download/vpn/$SERVER \
--mute-replay-warnings \
--script-security 2 \
--route-up /volume1/.@plugins/AppCentral/openvpn/CONTROL/route-up.sh
sleep 5
done
As per script, it 1st calls /etc/script/vpn.sh (with insmod), then launches openvpn, wich uses the --route-up to call route-up.sh wich is:
Code: Select all
#!/bin/sh
# filename: /root/openvpn/route-up.sh
IP=/root/openvpn/ip
ETH=eth0
TUN=tun0
# Cleanup
$IP route flush table 42
$IP route add $trusted_ip via $route_net_gateway dev $ETH
$IP route add ${trusted_ip%%.*}.0.0.0/1 via $ifconfig_remote dev $TUN
$IP route add 0.0.0.0/1 via $ifconfig_remote dev $TUN table 42
$IP rule del from all to $ifconfig_local lookup 42
$IP rule del from $ifconfig_local lookup 42
$IP rule add from all to $ifconfig_local lookup 42
$IP rule add from $ifconfig_local lookup 42
# Make sure transmission is stopped
/usr/local/AppCentral/transmission/CONTROL/start-stop.sh stop
# Wait a bit
sleep 5
# Update IP
sed -ie "s/\(.*ipv4\": \"\)[^\"]*\(.*\)/\1${ifconfig_local}\2/g" /usr/local/AppCentral/transmission/config/settings.json
# Start Transmission
/usr/local/AppCentral/transmission/CONTROL/start-stop.sh start
Of course, i copied the "ip" you gave me to /root/openvpn/
Unless i'm losing something, i'm using the scripts in the previous posts (?).