Hello all!
I searched quite a bit but couldn't figure out how to fix the following issue.
At the moment I am using OpenVPN on my RT-N66U router. I am trying to add an script that sends an email to me when someone connects.
The script can be found here:
http://www.snbforums.com/threads/tutori ... ons.20828/
I have uploaded this script to the /jffs/scripts partition of the router. I have also set these scripts to permissions 0777.
In the custom configuration I have added:
script-security 2
client-connect /jffs/scripts/up.sh
client-disconnect /jffs/scripts/down.sh
However it keeps giving me this error:
WARNING: Failed running command (--client-connect): could not execute external program
Could anyone help me with the error.
Thanks in advance!
[Solved] OpenVPN Script: WARNING: Failed running command
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 3
- Joined: Thu Aug 25, 2016 7:35 pm
-
- OpenVpn Newbie
- Posts: 3
- Joined: Thu Aug 25, 2016 7:35 pm
Re: OpenVPN Script
Using this made the script execute:
script-security 2
--client-connect "/bin/sh /jffs/scripts/up.sh"
--client-disconnect "/bin/sh /jffs/scripts/down.sh"
However it gave the following error: WARNING: Failed running command (--client-connect): external program exited with error status: 1
Something seems to be broken in the script. Can we verbose that error some more?
script-security 2
--client-connect "/bin/sh /jffs/scripts/up.sh"
--client-disconnect "/bin/sh /jffs/scripts/down.sh"
However it gave the following error: WARNING: Failed running command (--client-connect): external program exited with error status: 1
Something seems to be broken in the script. Can we verbose that error some more?
-
- OpenVpn Newbie
- Posts: 3
- Joined: Thu Aug 25, 2016 7:35 pm
Re: OpenVPN Script
I managed to fix it. The script was fixed using this command:
dos2unix /jffs/scripts/up.sh
Given to me by a person at this forum:
http://www.snbforums.com/threads/tutori ... ons.20828/
dos2unix /jffs/scripts/up.sh
Given to me by a person at this forum:
http://www.snbforums.com/threads/tutori ... ons.20828/
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: OpenVPN Script
dos2unix .. did not see that coming
Thanks for letting us know your solution (sorry we could not help)
Thanks for letting us know your solution (sorry we could not help)
-
- OpenVpn Newbie
- Posts: 2
- Joined: Thu Oct 12, 2017 9:10 am
Re: [Solved] OpenVPN Script: WARNING: Failed running command
Hello,
Even if I've used dos2unix 'script.sh' still did not have any luck.
So I've added exit 0 at the end of each script. Now they seem to work.
server : openvpn-2.4.0-2.mga5
client: openvpn-2.4.7-1.mga7
Even if I've used dos2unix 'script.sh' still did not have any luck.
So I've added exit 0 at the end of each script. Now they seem to work.
server : openvpn-2.4.0-2.mga5
client: openvpn-2.4.7-1.mga7
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: [Solved] OpenVPN Script: WARNING: Failed running command
Explicitly exiting with 0 is probably over riding the error your script has detected and is not recommended.
Better to understand why the script detected the error in the first place ..
Better to understand why the script detected the error in the first place ..