homepage Welcome to WebmasterWorld Guest from 23.20.77.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
howto start proces via browser with php script using sudo
cccc




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

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




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

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




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

hi

with

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

is working well!

regards
cccc

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved