#!/bin/bash

## Test to see if IRXevent is running first, if so kill it, then restart
#if ps -ef|grep -v grep|grep -i irxevent
#then
#ps aux|grep -i xaverius|grep -i irxevent |awk '{print $2}'|xargs kill 
#else
## Do nothing
#echo "irxevent already dead!"
#fi

## Test to see if IRexec is running first, if so kill it, then restart
#if ps -ef|grep -v grep|grep -vi start|grep -i irexec
#then
#ps aux|grep -i xaverius|grep -i irexec |grep -vi start|awk '{print $2}'|xargs kill
#else
## Do nothing
#echo "irexec already dead!"
#fi

killall irxevent
killall irexec

##test to see if an instance of irxevent is already running
#if ps -ef|grep -v grep|grep irxevent
#then
## do nothing
#echo "irxevent already running"
#else
## start irxevent
irxevent /home/xaverius/.lircrc &
#fi

##test to see if an instance of irexec is already running
#if ps -ef|grep -v grep|grep irexec
#then
## do nothing
#echo "irexec already running"
#else
## start irxevent
irexec -d /home/xaverius/.lircrc &
#fi
#
exit

