Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Start and stop Apache from the dock' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Start and stop Apache from the dock
Authored by: Graff on May 22, '03 08:14:55PM

On a side note, I had a problem with the line break in the second statement, after "(no pid file)"... I had to remove it to get the script to work.
Right, that's because the line break occurs within a quoted string. In order to break lines in code in the middle of a quoted string you need to make two strings with a concatenation and the line break in between them.

Original lines:
if result = "/usr/sbin/apachectl stop: httpd (no pid file) ¬
not running" then
do shell script "sudo /usr/sbin/apachectl start"

Corrected lines:
if result = "/usr/sbin/apachectl stop: httpd (no pid file)" & ¬
"not running" then
do shell script "sudo /usr/sbin/apachectl start"



[ Reply to This | # ]