Welcome to WebmasterWorld Guest from 54.227.5.198

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

howto start proces via browser with php script using sudo

     

cccc

10:34 am on Jan 12, 2004 (gmt 0)

10+ Year Member



hi

I wrote PHP script, to start vpnclient:

<?php

$result = exec("ping -c 4 X.X.X.X");

if ("$result?"!= "0") {

exec("/etc/init.d/vpnclient_init restart");

}

?>

from shell as root user this script is working well.

my problem is:
howto start vpnclient via browser with this script using sudo?

kind regards
cccc

coopster

10:11 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to WebmasterWorld, cccc!

I don't use sudo [courtesan.com] myself, but it seems as though you need to have your sudoers [courtesan.com] file setup correctly first. But before going there, is this a Cisco VPN client you are starting? Why not have the client start whenever the server is started/rebooted?

Hopefully this bump will get some discussion started.

cccc

5:13 pm on Jan 31, 2004 (gmt 0)

10+ Year Member



hi

with

exec("sudo -u root /etc/init.d/vpnclient_init restart");

is working well!

regards
cccc

 

Featured Threads

Hot Threads This Week

Hot Threads This Month