Why wont this script run??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx
Web: www.mobilethink.dk
................................


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux