ciber Posted June 2, 2010 Share Posted June 2, 2010 Hi, I have a perl script, which kicks my clients session when they have reached their usage limit on DSL. Currently I use a Perl script, to do this shell_exec("perl /usr/local/etc/raddb/scripts/rad-disc.pl -u ".$_GET['username']." -i ".$_GET['ip']." -n ".$_GET['nas']." -s 'secretgoe\$here'"); // -i --> IP // -u --> Username // -n --> NAS Server // -s --> Servers Secret (ie: Password) When I execute this script: perl /usr/local/etc/raddb/scripts/rad-disc.pl -u [email protected] -i xxx.xxx.xxx.xxx -n xxx.xxx.xxx.xxx -s 'secretgoe$here' in SSH, I get ACK response saying that the server has Acknowledged my request and disconnected the client, but when I execute it using PHP's shell_exec() (or exec()) (as show in the first line of code), the server responded with a NAK, Negative Acknowledgment. The files are set on root, and are set to execute 6777. I don't see why it would be doing this, unless shell_exec is doing something different that would be done in SSH. ------------------->>> In addition to this, I tried writing the script with the information from the database to a file, and then tried to execute that file using PHP. Again NAK. However when I try to execute that exact generated script using SSH - it executes perfect. Please if anyone can assist, I will be very grateful!! Link to comment https://forums.phpfreaks.com/topic/203632-execute-perl-radius-kick-using-php/ Share on other sites More sharing options...
kenrbnsn Posted June 2, 2010 Share Posted June 2, 2010 How are you running the PHP script? Via a web page or via the command line? Ken Link to comment https://forums.phpfreaks.com/topic/203632-execute-perl-radius-kick-using-php/#findComment-1066641 Share on other sites More sharing options...
ciber Posted June 2, 2010 Author Share Posted June 2, 2010 via a webpage, its a GUI for our staff to access the clients DSL accounts. And sometimes they are required to kick a client. Link to comment https://forums.phpfreaks.com/topic/203632-execute-perl-radius-kick-using-php/#findComment-1066781 Share on other sites More sharing options...
ciber Posted June 3, 2010 Author Share Posted June 3, 2010 *bump* Link to comment https://forums.phpfreaks.com/topic/203632-execute-perl-radius-kick-using-php/#findComment-1067206 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.