Blame | Last modification | View Log | RSS feed
#!/bin/bash## /etc/rc.d/init.d/wdaemon## Starts the wdaemon## chkconfig: - 95 5# description: helps X.org to support Wacom tablets hotplugging by creating \# permanent uinput devices that may be feeded by real tablets events while \# the hardware is present.# processname: wdaemon# Source function library.. /etc/init.d/functionstest -x /usr/bin/wdaemon || exit 0RETVAL=0## See how we were called.#prog="wdaemon"start() {# Check if there's already a configuration presentif [ ! -f /etc/wdaemon.conf ]; thenecho "wdaemon configuration file not present yet";return 0;fi# Check if wdaemon is already runningif [ ! -f /var/lock/subsys/wdaemon ]; thenif [ -z "$(lsmod | grep uinput)" ]; thenecho -n $"Loading uinput module: "modprobe uinput;RETVAL=$?[ $RETVAL -eq 0 ] && success || (failure; return $RETVAL);echo;fiecho -n $"Starting $prog: "daemon /usr/bin/wdaemon -s -c /etc/wdaemon.conf -f;RETVAL=$?[ $RETVAL -eq 0 ] && (success; touch /var/lock/subsys/wdaemon) || failure;echofireturn $RETVAL}stop() {echo -n $"Stopping $prog: "killproc /usr/bin/wdaemonRETVAL=$?[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/wdaemonechoreturn $RETVAL}restart() {stopstart}reload() {restart}status_at() {status /usr/bin/wdaemon}case "$1" instart)start;;stop)stop;;reload|restart)restart;;condrestart)if [ -f /var/lock/subsys/wdaemon ]; thenrestartfi;;status)status_at;;*)echo $"Usage: $0 {start|stop|restart|condrestart|status}"exit 1esacexit $?exit $RETVAL