Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 May 2001 13:23:08 -0500
From:      Mike Meyer <mwm@mired.org>
To:        "Educatee" <educatee2001@yahoo.com>
Cc:        questions@freebsd.org
Subject:   Re: How to make a script recognized "stop"
Message-ID:  <15090.62348.655622.15519@guru.mired.org>
In-Reply-To: <114228913@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Educatee <educatee2001@yahoo.com> types:
> I have put a few line to run http-gw in a script file http-gw.sh:
> 
> -------------------
> #!/bin/sh
> /usr/local/libexec/http-gw -daemon 3210
> echo -n 'http-gw started ok'
> -------------------
> 
> How could I make it recognized the stop signal. As everytime when I reboot
> my machine using
> 
> shutdown -r now
> 
> I was prompt that this script does not recognized the stop  and was
> recommended to do so. Can you please help me? Thanks.

The skeleton to use is:

case $1 in
start)
	# Code to run at system startup time.
	;;
stop)
	# Code to run at system shutdown time
	;;
*)
	echo "usage: `basename $0` (start|stop)" >&2
	exit 64
	;;
esac


> By the way, I am very new to FreeBSD and will like to learn how to write
> script. Can you please recommend some URL or books. Thanks.

Well, I like the K&P's "Unix Programming Environment", but it's a bit
dated.

--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15090.62348.655622.15519>