source: packages/net/freeswitch/files/freeswitch.init @ 22782

Last change on this file since 22782 was 22782, checked in by cshore, 6 years ago

[packages] net/freeswitch: Use /usr/share/freeswitch as prefix; this means freeswitch files not in bin, lib, or include will be stored under /usr/share/freeswitch.

Modify the configuration so that recordings are stored on /var/lib/freeswitch/recordings by default (this is a tmpfs so should be change if persistance is needed).
Allow the scripts and htdocs to have their directories set individually instead of requirings them to be under /usr/share/freeswitch.

File size: 841 bytes
Line 
1#!/bin/sh /etc/rc.common
2# Copyright (C) 2006 OpenWrt.org
3START=90
4
5DEFAULT=/etc/default/freeswitch
6OPTIONS=""
7
8boot() {
9        # Do nothing on boot
10        exit 0
11}
12
13start() {
14        [ -f $DEFAULT ] && . $DEFAULT
15        mkdir -p $FS_DIR_DB
16        mkdir -p $FS_DIR_LOG
17        mkdir -p $FS_DIR_RECORDINGS
18        mkdir -p $FS_DIR_VM_STORAGE
19        ulimit -s 240
20        $FS_DIR/usr/bin/freeswitch $OPTIONS -nc
21}
22
23stop() {
24        [ -f $DEFAULT ] && . $DEFAULT
25        $FS_DIR/usr/bin/freeswitch $OPTIONS -stop
26}
27
28restart() {
29        # stopping freeswitch is non-blocking, so we wait until freeswitch's
30        # event socket is down, and then wait an additional ten seconds so that
31        # freeswitch should be completely shutdown before we start it again
32        local retval
33        stop
34        fs_cli -x status >/dev/null 2>&1
35        retval=$?
36        while [ $retval -eq 0 ]; do sleep 1; fs_cli -x status >/dev/null 2>&1; retval=$?; done
37        sleep 10
38        start
39}
40
Note: See TracBrowser for help on using the repository browser.