diff options
author | sibel <sibel@free.fr> | 2010-04-21 15:23:54 +0200 |
---|---|---|
committer | sibel <sibel@free.fr> | 2010-04-21 15:23:54 +0200 |
commit | 15e991f88d923b586dd811bfb3a7bc4b5b2623ec (patch) | |
tree | 7d17e34f7b3d18c81d66fddcf6f21644b5d05eb7 /extra/brltty/brltty | |
parent | 1faca460551c77a15d0ae06365788fe1697a86b7 (diff) | |
download | nutyx-extra-15e991f88d923b586dd811bfb3a7bc4b5b2623ec.tar.gz nutyx-extra-15e991f88d923b586dd811bfb3a7bc4b5b2623ec.tar.bz2 nutyx-extra-15e991f88d923b586dd811bfb3a7bc4b5b2623ec.tar.xz nutyx-extra-15e991f88d923b586dd811bfb3a7bc4b5b2623ec.zip |
Ajout de brltty#4.1-1
Diffstat (limited to 'extra/brltty/brltty')
-rw-r--r-- | extra/brltty/brltty | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/extra/brltty/brltty b/extra/brltty/brltty new file mode 100644 index 000000000..5ed21a52d --- /dev/null +++ b/extra/brltty/brltty @@ -0,0 +1,68 @@ +#!/bin/bash + +daemon_name=brltty + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + +get_pid() { + pidof -o %PPID $daemon_name +} + +case "$1" in + start) + stat_busy "Starting $daemon_name daemon" + + PID=$(get_pid) + if [ -z "$PID" ]; then + [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid + # RUN + $daemon_name $brltty_args + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + echo $(get_pid) > /var/run/$daemon_name.pid + add_daemon $daemon_name + stat_done + fi + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping $daemon_name daemon" + PID=$(get_pid) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + rm -f /var/run/$daemon_name.pid &> /dev/null + rm_daemon $daemon_name + stat_done + fi + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + ;; + + *) + echo "usage: $0 {start|stop|restart|status}" +esac + +exit 0 |