do shell script - which shell?
do shell script - which shell?
- Subject: do shell script - which shell?
- From: Chris Garaffa <email@hidden>
- Date: Sat, 06 Apr 2002 16:03:09 -0500
Hello all,
I've got a little script to manipulate Apache via the apachectl command:
--script beginning--
on run
set apache_action_list to {"Start", "Stop", "Restart", "Graceful
Restart"}
set apache_action to choose from list apache_action_list with
prompt "Do what to Apache?" without multiple selections allowed and
empty selection allowed
set apache_action_str to apache_action as string
(*display dialog apache_action_str*)
if apache_action_str is equal to "Start" then
do shell script "apachectl start"
display dialog "Apache started"
end if
if apache_action_str is equal to "Stop" then
do shell script "apachectl stop"
display dialog "Apache stopped"
end if
if apache_action_str is equal to "Restart" then
do shell script "apachectl restart"
display dialog "Apache restarted"
end if
if apache_action_str is equal to "Graceful Restart" then
do shell script "apachectl graceful"
display dialog "Apache gracefully restarted"
end if
end run
--script end--
Well, I get the error
"zsh: command not found: apachectl"
However, I don't use zsh! My preferred shell in Terminal is tcsh, and it
is set that way...
I tried adding this line to the beginning of my script:
do script "tcsh"
with no results...
Should I run this through Terminal, as in,
if apache_action_str is equal to "Start" then
tell application Terminal
do script with command "apachectl start"
end tell
end if
I don't want to have Teminal starting, though, because I plan to put
this in the Script Menu, and it seems a bit too intrusive to have
Terminal opening up windows and such...
Any ideas?
Thanks,
Chris
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.