summaryrefslogtreecommitdiff
path: root/audio/nas/rc.nasd.new
blob: 182b9c14c52dac7cb574ad3eb461385a91dd7583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

start() {
   if [ -x /usr/bin/nasd ]; then
        if [ -n "$(pgrep nasd)" ]; then
            echo "Starting nasd /usr/bin/nasd"
            /usr/bin/nasd :0 -aa -b 
        else
            echo "nasd already running"
            exit 1
        fi
   fi
}

stop() {
    killall nasd
}

restart() {
   stop
   sleep 1
   start
}

case "$1" in
   'start')
      start
      ;;
   'stop')
      stop
      ;;
   'restart')
      restart
      ;;
   *)
      echo "usage $0 start|stop|restart" ;;
esac