Skip to content

Instantly share code, notes, and snippets.

@richardpeng
Created October 7, 2010 15:44
Show Gist options
  • Save richardpeng/615318 to your computer and use it in GitHub Desktop.
Save richardpeng/615318 to your computer and use it in GitHub Desktop.
#/bin/bash
# Switch between XBMC and Boxee
if ps ax | grep -v grep | grep xbmc.bin > /dev/null
then
echo "XBMC running, killing process"
kill `pidof xbmc.bin`
sleep 7
echo "running Boxee"
/usr/bin/runBoxee &
elif ps ax | grep -v grep | grep Boxee > /dev/null
then
echo "Boxee running, killing process"
kill `pidof Boxee`
sleep 7
echo "running XBMC"
/usr/bin/runXBMC &
else
echo "No UI running, starting XBMC"
/usr/bin/runXBMC &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment