Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-12-2004, 05:16 AM   #1
Senior Member
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 50
howto start vpnclient with php script and sudo ?


I wrote PHP script, to start vpnclient on my linux server:


$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 ?

I'm using linux SuSE 8.2 and Apache 1.3.27

kind regards
Old 01-12-2004, 11:46 AM   #2
Senior Member
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 50
I tried with :

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

and is working well.


Last edited by cccc; 01-31-2004 at 06:52 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto start script at boot ? hendrixx Programming 3 11-15-2005 01:42 PM
howto start a perl script only from tuesday to friday at 8.00 am ? cccc Linux - Newbie 4 03-19-2005 04:23 AM
PHP HOWTO : Run script as root guideweb Linux - Software 3 08-22-2004 11:38 PM
Help with Howto start a shell script at boot draven Linux - Newbie 7 03-03-2004 11:20 PM
I'm looking for a script to keep cisco vpnclient up and running cccc Linux - Networking 0 09-16-2003 04:09 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:51 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration