#!/bin/sh # # $Id: zvbid.init.in,v 1.3 2004/10/04 20:48:58 mschimek Exp $ # Startup script for the vboxprinter daemon, RedHat style. # # This is just an example, it will not install. Packagers must # prepare an init script matching their system. # # chkconfig: - 90 01 # description: Proxy daemon to share a v4l vbi device between applications. # . /etc/init.d/functions VBOXUSER=repa [ -x /usr/bin/VBoxManage ] || exit 1 RETVAL=0 start(){ echo -n $"Starting Windows VBox printer: " su $VBOXUSER -c "VBoxManage startvm 'Windows 7' --type headless" RETVAL=$? echo touch /var/lock/subsys/vboxprinter return $RETVAL } stop(){ echo -n $"Stopping Windows VBox printer: " su $VBOXUSER -c "VBoxManage controlvm 'Windows 7' acpipowerbutton" echo RETVAL=$? rm -f /var/lock/subsys/vboxprinter return $RETVAL } restart(){ stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status vboxprinter ;; condrestart) [ -e /var/lock/subsys/vboxprinter ] && restart ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart}" RETVAL=1 esac exit $RETVAL