INIT Script for DUDE


#!/bin/bash

action=${1}

. /etc/rc.d/init.d/functions

User Options
xvfb_pidfile=’/var/run/dude-xvfb.pid’
wine_pidfile=’/var/run/dude-wine.pid’
virtual_display=’:1′

export DISPLAY=$virtual_display
export WINEPREFIX=’/srv/wine’

start ()
{
echo -n ‘Starting Dude virtual display:’
Xvfb $virtual_display &> /dev/null &
echo $! > $xvfb_pidfile
success
echo
echo -n ‘Starting Dude Server:’
sleep 5
wine ‘c:\program files\dude\dude.exe’ –server &> /dev/null &
echo $! > $wine_pidfile
success
touch /var/lock/subsys/dude
echo
}

stop ()
{
echo -n ‘Stopping Dude Server:’
kill $(cat $wine_pidfile)
rm -f $wine_pidfile
sleep 5
success
echo
echo -n ‘Stopping Dude virtual display:’
kill $(cat $xvfb_pidfile)
rm -f $xvfb_pidfile
success
rm -f /var/lock/subsys/dude
echo
}

case “$action” in
start)
start
;;

stop)
stop
;;

*)
echo “Usage: $0 {start|stop}”
;;
esac

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s