Why wont this script run??

Søren Neigaard s.neigaard at mobilethink.dk
Wed Oct 12 13:36:52 UTC 2005


Somehow my /etc/init.d/httpd script broke (i did not alter it), and i 
dont know how to fix it, but i found out that simply running 
"/usr/sbin/httpd" starts apache, but apachectl does not. So my plan was 
to make a really simple script that runs "/usr/sbin/httpd" like the 
following:

--- SCRIPT ---
#!/bin/bash

start() {
         echo "Starting httpd"
         /usr/sbin/httpd
}
stop() {
         echo "Stopping httpd"
         killall -9 httpd
         rm -f /var/run/httpd.pid /var/lock/subsys/httpd
}

restart() {
         stop
         start
}

case "$1" in
         start)
                 start
                 ;;
         stop)
                 stop
                 ;;
         restart)
                 restart
                 ;;
         *)
                 echo $"Usage: $0 {start|stop|restart}"
                 exit 1
esac

exit $?
--- SCRIPT ---

But it gives me this:

: bad interpreter: No such file or directory

Im no shell programmer, so i have no clue... Any ideas folks?

-- 
Med venlig hilsen/Best regards
Søren Neigaard
System Architect
................................
Mobilethink A/S
Arosgaarden
Åboulevarden 23, 4.sal
DK - 8000 Århus C
Telefon: +45 86207800
Direct: +45 86207810
Fax: +45 86207801
Email: s.neigaard at mobilethink.dk
Web: www.mobilethink.dk
................................




More information about the fedora-list mailing list