Am Dienstag, 6. Mai 2003 20:14
schrieb "Dirk Ellinger"
Hi Liste, Wie erreiche ich in einem Shell-Script, dass der Befehl << rcapache restart >> ausgeführt wird? Die Angabe <> führt zu Fehlern. Danke, Dirk.
Hallo Gemeinde, Hallo Dirk, *ungetestet* ---schnipp--- #!/bin/sh # /etc/rc.d/apache PID=/var/run/httpd.pid Modules "´"´ SERVER=/usr/sbin/httpd CONFIG=/etc/httpd/httpd.conf case "´$1"´ in start) echo -n "´Starting httpd... "´ if [ -f $SERVER -a -a $CONFIG ]; then $SERVER -f $CONFIG $MODULES echo "´running"´ else echo "´failed"´ fi ;; stop) echo -n "´Shutting down httpd... "´ if [ -f ${PID} ]; then kill `cat ${PID}` echo "´stopped"´ else echo "´failed"´ fi ;; restart) $0 stop && sleep 10 && $0 start esac exit 0 ---schnapp--- Hier müssten noch Module und Pfadnamen von dir überarbeitet werden. Quelle: Linux- Server für Intranet und Internet ISBN 3-446-21936-6 HTH, George -- Pound for pound, the amoeba is the most vicious animal on earth.