Guest User

Untitled

a guest
Nov 12th, 2011
164
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. . /etc/rc.conf
  4. . /etc/rc.d/functions
  5.  
  6. PID=$(pidof -o %PPID /usr/bin/xboxdrv)
  7. case "$1" in
  8. start)
  9. stat_busy "Starting xboxdrv, stopping xpad"
  10. rmmod xpad &> /dev/null
  11. [ -z "$PID" ] && /usr/bin/xboxdrv -D --detach --silent --no-dbus &> /dev/null
  12. if [[ $? -gt 0 ]]; then
  13. stat_fail
  14. else
  15. add_daemon xboxdrv
  16. stat_done
  17. fi
  18. ;;
  19. stop)
  20. stat_busy "Stopping xboxdrv, starting xpad"
  21. [[ ! -z "$PID" ]] && kill $PID &> /dev/null
  22. if [[ $? -gt 0 ]]; then
  23. stat_fail
  24. else
  25. modprobe xpad &> /dev/null
  26. rm_daemon xboxdrv
  27. stat_done
  28. fi
  29. ;;
  30. restart)
  31. $0 stop
  32. sleep 1
  33. $0 start
  34. ;;
  35. *)
  36. echo "usage: $0 {start|stop|restart}"
  37. esac
  38. exit 0
  39.  
  40.  
RAW Paste Data