Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- . /etc/rc.conf
- . /etc/rc.d/functions
- PID=$(pidof -o %PPID /usr/bin/xboxdrv)
- case "$1" in
- start)
- stat_busy "Starting xboxdrv, stopping xpad"
- rmmod xpad &> /dev/null
- [ -z "$PID" ] && /usr/bin/xboxdrv -D --detach --silent --no-dbus &> /dev/null
- if [[ $? -gt 0 ]]; then
- stat_fail
- else
- add_daemon xboxdrv
- stat_done
- fi
- ;;
- stop)
- stat_busy "Stopping xboxdrv, starting xpad"
- [[ ! -z "$PID" ]] && kill $PID &> /dev/null
- if [[ $? -gt 0 ]]; then
- stat_fail
- else
- modprobe xpad &> /dev/null
- rm_daemon xboxdrv
- stat_done
- fi
- ;;
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement