
# Copyright 1999 Robert Ransbottom

HBBPATHNAME=$1


if [ -z $HBBPATHNAME ]
then
	echo "HBBPATHNAME is not defined"
	exit -1
fi


echo "#!/bin/sh
#
# Start or stop hbb
#
# Robert Ransbottom rir@mediaone.net

# XXX  This is not robust.  Linux 2.2.11 doesn't handle
#      multiple invocations of this script.

#test -x /sbin/hbb || exit 0

case \"\$1\" in
    start)
	echo \"Starting binary format hbb service: hbb\"
	echo ':hbb:M::#!!::$HBBPATHNAME:' > /proc/sys/fs/binfmt_misc/register
	echo '1' > /proc/sys/fs/binfmt_misc/hbb
	echo \".\"	
    ;;

    stop)
	echo -n \"Stopping binary format hbb service: hbb\"
	echo '0' > /proc/sys/fs/binfmt_misc/hbb
	echo \".\"	
    ;;

    restart)
        \$0 stop
        \$0 start
    ;;

    reload)
        \$0 restart
    ;;

    force-reload)
        \$0 restart
    ;;

    *)
	echo \"Usage: \$0 {start|stop|reload|restart|force-reload}\" >&2
	exit 1
    ;;
esac

exit 0" > hbb.boot
