Lines 1-8
Link Here
|
1 |
#!/bin/sh |
1 |
#!/bin/sh |
2 |
|
2 |
|
|
|
3 |
# $FreeBSD$ |
4 |
# |
3 |
# PROVIDE: freeswitch |
5 |
# PROVIDE: freeswitch |
4 |
# REQUIRE: DAEMON |
6 |
# REQUIRE: DAEMON |
5 |
# KEYWORD: FreeBSD |
7 |
# KEYWORD: shutdown |
6 |
|
8 |
|
7 |
. /etc/rc.subr |
9 |
. /etc/rc.subr |
8 |
|
10 |
|
Lines 12-50
Link Here
|
12 |
command=%%PREFIX%%/freeswitch/bin/freeswitch |
14 |
command=%%PREFIX%%/freeswitch/bin/freeswitch |
13 |
command_args="-nc" |
15 |
command_args="-nc" |
14 |
|
16 |
|
15 |
pidfile=${freeswitch_pidfile:-"%%PREFIX%%/freeswitch/log/freeswitch.pid"} |
|
|
16 |
|
17 |
freeswitch_enable=${freeswitch_enable-"YES"} |
18 |
|
19 |
start_cmd="freeswitch_start" |
17 |
start_cmd="freeswitch_start" |
20 |
stop_precmd="freeswitch_stop" |
18 |
stop_precmd="freeswitch_stop" |
21 |
restart_cmd="freeswitch_restart" |
19 |
restart_cmd="freeswitch_restart" |
22 |
|
20 |
|
23 |
sig_stop=KILL |
21 |
sig_stop=KILL |
24 |
|
|
|
25 |
load_rc_config $name |
26 |
|
22 |
|
27 |
freeswitch_stop () { |
23 |
freeswitch_stop () { |
28 |
echo "Stopping Freeswitch." |
24 |
echo "Stopping Freeswitch." |
29 |
%%PREFIX%%/freeswitch/bin/freeswitch -stop |
25 |
%%PREFIX%%/freeswitch/bin/freeswitch -stop |
30 |
sleep 1 |
26 |
sleep 1 |
31 |
return 0 |
|
|
32 |
} |
27 |
} |
33 |
|
28 |
|
34 |
freeswitch_start () { |
29 |
freeswitch_start () { |
35 |
echo "Starting FreeSwitch." |
30 |
echo "Starting FreeSwitch." |
36 |
/usr/sbin/daemon -f /bin/sh -c "$command" |
31 |
/usr/sbin/daemon -f /bin/sh -c "$command" # $command_args? |
37 |
sleep 1 |
32 |
sleep 1 |
38 |
return |
|
|
39 |
} |
33 |
} |
40 |
|
34 |
|
|
|
35 |
# Probably not necessary? |
41 |
freeswitch_restart () { |
36 |
freeswitch_restart () { |
42 |
echo "ReStarting FreeSwitch." |
37 |
echo "Restarting FreeSwitch." |
43 |
freeswitch_stop |
38 |
freeswitch_stop |
44 |
freeswitch_start |
39 |
freeswitch_start |
45 |
sleep 1 |
40 |
sleep 1 |
46 |
return |
41 |
} |
47 |
} |
|
|
48 |
|
42 |
|
49 |
run_rc_command "$1" |
43 |
load_rc_config $name |
50 |
|
44 |
|
|
|
45 |
: ${freeswitch_enable="YES"} |
46 |
pidfile="${freeswitch_pidfile:-"%%PREFIX%%/freeswitch/log/freeswitch.pid"}" |
47 |
|
48 |
run_rc_command "$1" |