Skip to content

Instantly share code, notes, and snippets.

@richardpeng
Created October 7, 2010 15:43
Show Gist options
  • Save richardpeng/615315 to your computer and use it in GitHub Desktop.
Save richardpeng/615315 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Checks to see if irexec is running and runs it if not already running.
youruser=richard
# 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 $youruser|grep -i irexec |grep -vi start|awk '{print $2}'|xargs kill
else
# Do nothing
echo "irexec already dead!"
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/$youruser/.lircrc &
fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment