#!/bin/sh
# Start/stop the VAX virtual guest
#
### BEGIN INIT INFO
# Provides:          vax
# Required-Start:    
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      1
# Short-Description: Virtual VAX (SIMH)
# Description:       VAX is a virtual computer system running under a VAX
#                    emulator that is part of SIMH. This VAX host runs OpenVMS.
### END INIT INFO

test -f /vax/vax || exit 0
test -f /vax/vax.ini || exit 0

. /lib/lsb/init-functions

case "$1" in
start)	log_daemon_msg "Starting VAX emulator" "vax"
        start-stop-daemon --start --quiet --pidfile $PIDFILE --name vax --startas /vax/start-vax -- $LSBNAMES 
        log_end_msg $?
	;;
stop)	log_daemon_msg "Stopping VAX emulator" "vax"
        start-stop-daemon --stop --quiet --pidfile $PIDFILE --name vax
        log_end_msg $?
        ;;
status)
	status_of_proc -p $PIDFILE /vax/bin/vax vax && exit 0 || exit $?
	;;
*)	log_action_msg "Usage: /etc/init.d/cron {start|stop|status}"
        exit 2
        ;;
esac
exit 0
