recently (i dont know exactly when) my up and down script doesnt work anymore. After few test it seems it s a permission problem.
I dont understand how it possible because (normally) my script is running as root...
This is my conf file :
Code: Select all
client
dev tun
proto tcp
nobind
;Pas de modification depuis le serveur de la table de routage
route-nopull
;Scripts locaux gérant les routes et le client torrent
script-security 2
up up.sh
down down.sh
;CERT
tls-auth ta.key 1
ca ca.crt
cipher AES-256-CBC
keysize 256
link-mtu 1560
;HOST
remote-random
remote nl10.vpnfacile.net 443
remote nl9.vpnfacile.net 443
remote nl8.vpnfacile.net 443
remote nl6.vpnfacile.net 443
remote nl5.vpnfacile.net 443
remote nl4.vpnfacile.net 443
remote nl1.vpnfacile.net 443
resolv-retry infinite
;AUTH
auth-user-pass pass
persist-key
persist-tun
comp-lzo
;Maintien de la connexion: ping envoyé toutes les 10s, restart si pas de réponses pendant 60s
keepalive 10 60
Code: Select all
#! /bin/sh
#
#Creation de la route pour mon VPN
echo "$dev : $ifconfig_local -> $ifconfig_remote gw: $route_vpn_gateway"
ip route add default via $ifconfig_remote dev $dev table VPN
ip rule add from $ifconfig_local/32 table VPN
ip rule add to $ifconfig_remote/32 table VPN
ip route flush cache
/etc/init.d/transmission-daemon stop
sed s/IP_ADDRESS/$ifconfig_local/ /etc/transmission-daemon/settings-template.json > /etc/transmission-daemon/settings.json
/etc/init.d/transmission-daemon start
#Demarrage du script verifiant que le VPN est toujours actif
killall checkVPN
/usr/bin/checkVPN &
The permission problem is on the "sed" line but as root i dont understand how it s possible.
Thanks in advance for your help !
Flo