Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-31-2007, 06:13 AM   #1
Registered: Mar 2006
Location: belguim
Distribution: fedora, mandriva, suse
Posts: 148

Rep: Reputation: 15
simple bash scripting help

ok, this is what i got:

#start of script
if [ -e /var/run/pid ]; then
echo apache is allready running
/etc/init.d/httpd start
and it gives a command like this: ./script startapache
but i want to do ./script apache start
how do i do this?

is it like this?

#start of script
/etc/init.d/httpd start
/etc/init.d/httpd stop

if i do this, i just won't run. what am i doing wrong?
Old 07-31-2007, 07:11 AM   #2
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102

Rep: Reputation: 15
Don't You have the start and stop scripts that come along with apache?
Otherwise, take a look at the service start/stop scripts that reside in /etc/init.d/ (or where Your distro puts them) and just copy and modify one.

Old 07-31-2007, 08:26 AM   #3
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
In your other scripting needs, take a look at if you have time.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Scripting Help hopspitfire Linux - General 2 06-12-2007 05:46 PM
simple scripting help please kb100 Programming 3 08-18-2006 09:08 AM
Very simple BASH scripting question clickster Linux - Newbie 6 11-23-2005 05:28 PM
Simple bash/awk/sed scripting question R00ts Programming 4 04-16-2005 03:55 AM
Bash Scripting--Simple Question mooreted Linux - General 4 05-10-2004 02:44 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:10 PM.

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