[QA] Remove executable bit from files, bug 550434.
[gentoo.git] / app-misc / conmux / files / conmux-registry.initd
1 #!/sbin/runscript
2 # Copyright 1999-2014 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 checkconfig() {
6         # Set sane defaults
7         if [ -z ${CONMUX_REGISTRY_PORT} ]; then
8                 CONMUX_REGISTRY_PORT="63000"
9         fi
10         if [ -z ${CONMUX_REGISTRY_LOG} ]; then
11                 CONMUX_REGISTRY_LOG="/var/log/conmux-registry.log"
12         fi
13 }
14
15 start() {
16         checkconfig
17         # Make sure conmux finds everything
18         export PATH="${PATH}:/usr/share/conmux/drivers:/usr/share/conmux/helpers"
19         ebegin "Starting conmux registry daemon"
20         [ -e ${CONMUX_REGISTRY_LOG} ] && rm ${CONMUX_REGISTRY_LOG}
21         touch ${CONMUX_REGISTRY_LOG}
22         start-stop-daemon -b -m --start -p /run/conmux-registry.pid \
23                 --exec /usr/sbin/conmux-registry -- ${CONMUX_REGISTRY_PORT} \
24                         ${CONMUX_REGISTRY_LOG}
25 }
26
27 stop() {
28         ebegin "Stopping conmux registry daemon"
29         start-stop-daemon --stop --pidfile /run/conmux-registry.pid
30         eend $?
31 }