source: roaraudio/dist/archlinux/roard @ 5439:7950543cabbc

Last change on this file since 5439:7950543cabbc was 1449:e67252883ec5, checked in by phi, 15 years ago

first version of archlinux rc script by kalasmannen

File size: 731 bytes
Line 
1#!/bin/bash
2
3# source application-specific settings
4ROARD_ARGS='--daemon'
5[ -f /etc/conf.d/roard ] && . /etc/conf.d/roard
6
7. /etc/rc.conf
8. /etc/rc.d/functions
9
10PID=`pidof -o %PPID /usr/bin/roard`
11case "$1" in
12  start)
13    stat_busy "Starting Roaraudio Daemon"
14    [ -z "$PID" ] && /usr/bin/roard ${ROARD_ARGS}
15    if [ $? -gt 0 ]; then
16      stat_fail
17    else
18      add_daemon roard
19      stat_done
20    fi
21    ;;
22  stop)
23    stat_busy "Stopping Roaraudio Daemon"
24    [ ! -z "$PID" ]  && kill $PID &> /dev/null
25    if [ $? -gt 0 ]; then
26      stat_fail
27    else
28      rm_daemon roard
29      stat_done
30    fi
31    ;;
32  restart)
33    $0 stop
34    sleep 1
35    $0 start
36    ;;
37  *)
38    echo "usage: $0 {start|stop|restart}" 
39esac
40exit 0
Note: See TracBrowser for help on using the repository browser.