Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to auto start web server after reboot

Status
Not open for further replies.

nwo4life

Technical User
May 16, 2002
23
US
How do I setup a script to issue the following commands in order.

owsctl start
owsctl start -nodemgr

source this profile . .profile2 then issue the next command.
f60ctl start

Thanks
 
Use this as a model. If the you need more environment stuff from the .profile2, just put it in here.

Code:
#!/sbin/sh
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident  "@(#)apache.sh  1.3     99/11/10 SMI"

APACHE_HOME=/usr/local/apache
CONF_FILE=/usr/local/apache/conf/httpd.conf
PIDFILE=/var/run/httpd.pid

if [ ! -f ${CONF_FILE} ]; then
        echo "can't find ${CONF_FILE}"
        exit 0
fi

case "$1" in
start)
        /bin/rm -f ${PIDFILE}
        cmdtext="starting"
        ;;
restart)
        cmdtext="restarting"
        ;;
stop)
        cmdtext="stopping"
        ;;
*)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac

echo "httpd $cmdtext."

status=`${APACHE_HOME}/bin/apachectl $1 2>&1`

if [ $? != 0 ]; then
        echo "$status"
        exit 1
fi
exit 0

--
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top