Lines 70-75
do_reload() {
Link Here
|
70 |
koha-start-sip $(koha-list --enabled) |
70 |
koha-start-sip $(koha-list --enabled) |
71 |
} |
71 |
} |
72 |
|
72 |
|
|
|
73 |
# |
74 |
# Function that checks zebrasrv is running for the specified instance |
75 |
# |
76 |
is_zebra_running() |
77 |
{ |
78 |
local instancename=$1 |
79 |
|
80 |
if daemon --name="$instancename-koha-zebra" \ |
81 |
--user="$instancename-koha.$instancename-koha" \ |
82 |
--running ; then |
83 |
return 0 |
84 |
else |
85 |
return 1 |
86 |
fi |
87 |
} |
88 |
|
89 |
# |
90 |
# Function that checks SIP server is running for the specified instance |
91 |
# |
92 |
is_sip_running() |
93 |
{ |
94 |
local instancename=$1 |
95 |
|
96 |
if daemon --name="$instancename-koha-sip" \ |
97 |
--user="$instancename-koha.$instancename-koha" \ |
98 |
--running ; then |
99 |
return 0 |
100 |
else |
101 |
return 1 |
102 |
fi |
103 |
} |
104 |
|
105 |
# |
106 |
# Function that shows the status of the zebrasrv daemon for |
107 |
# enabled instances |
108 |
# |
109 |
zebra_status() |
110 |
{ |
111 |
for instance in $(koha-list --enabled); do |
112 |
|
113 |
log_daemon_msg "Zebra server running for instace $instance" |
114 |
|
115 |
if is_zebra_running $instance ; then |
116 |
log_end_msg 0 |
117 |
else |
118 |
log_end_msg 1 |
119 |
fi |
120 |
done |
121 |
} |
122 |
|
123 |
# |
124 |
# Function that shows the status of the SIP server daemon for |
125 |
# enabled instances |
126 |
# |
127 |
sip_status() |
128 |
{ |
129 |
for instance in $(koha-list --enabled --sip); do |
130 |
|
131 |
log_daemon_msg "SIP server running for instace $instance" |
132 |
|
133 |
if is_sip_running $instance ; then |
134 |
log_end_msg 0 |
135 |
else |
136 |
log_end_msg 1 |
137 |
fi |
138 |
done |
139 |
} |
140 |
|
73 |
case "$1" in |
141 |
case "$1" in |
74 |
start) |
142 |
start) |
75 |
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" |
143 |
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" |
Lines 108-120
case "$1" in
Link Here
|
108 |
;; |
176 |
;; |
109 |
esac |
177 |
esac |
110 |
;; |
178 |
;; |
111 |
# TODO: Implement this. It should check every daemon is running |
179 |
status) |
112 |
# status) |
180 |
zebra_status |
113 |
# status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? |
181 |
sip_status |
114 |
# ;; |
182 |
;; |
115 |
*) |
183 |
*) |
116 |
#echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 |
184 |
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 |
117 |
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 |
|
|
118 |
exit 3 |
185 |
exit 3 |
119 |
;; |
186 |
;; |
120 |
esac |
187 |
esac |
121 |
- |
|
|