/[gentoo-x86]/media-video/ushare/files/ushare.init.d
Gentoo

Contents of /media-video/ushare/files/ushare.init.d

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sun Sep 16 14:29:57 2012 UTC (2 years, 5 months ago) by hwoarang
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
Revert my last commit

(Portage version: 2.1.11.17/cvs/Linux x86_64)

1 #!/sbin/runscript
2 # Copyright 1999-2012 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-x86/media-video/ushare/files/ushare.init.d,v 1.3 2012/09/16 14:29:05 hwoarang Exp $
5
6 depend() {
7 use net
8 }
9
10 start() {
11 ebegin "Starting uShare"
12
13 # Sanity check to avoid ushare failling on booting with no
14 # shared dirs
15 if [[ -z "${USHARE_DIRS}" ]] ; then
16 eerror "Please set shared dirs in /etc/conf.d/ushare"
17 return 1
18 fi
19
20 if [[ -z "${USHARE_PORT}" ]] ; then
21 einfo "${USHARE_NAME} runs on a dynamic port"
22 local ushare_port=
23 else
24 local ushare_port="--port ${USHARE_PORT}"
25 einfo "${USHARE_NAME} using port ${USHARE_PORT}"
26 fi
27
28 if [[ "${USHARE_TELNET}" == "yes" ]] ; then
29 local ushare_telnet=
30 else
31 local ushare_telnet="--no-telnet"
32 fi
33
34 if [[ -z "${ushare_telnet}" ]] ; then
35 if [[ -z "${USHARE_TELNET_PORT}" ]] ; then
36 local ushare_telnet_port=
37 einfo "${USHARE_NAME} runs telnet on the default port"
38 else
39 local ushare_telnet_port="--telnet-port ${USHARE_TELNET_PORT}"
40 einfo "${USHARE_NAME} runs telnet on port ${USHARE_TELNET_PORT}"
41 fi
42 else
43 local ushare_telnet_port=
44 fi
45
46 if [[ "${USHARE_WEB}" == "yes" ]] ; then
47 local ushare_web=
48 else
49 local ushare_web="--no-web"
50 fi
51
52 if [[ "${USHARE_XBOX}" == "yes" ]] ; then
53 local ushare_xbox="--xbox"
54 else
55 local ushare_xbox=
56 fi
57
58 if [[ "${USHARE_DLNA}" == "yes" ]] ; then
59 local ushare_dlna="--dlna"
60 else
61 local ushare_dlna=
62 fi
63
64 start-stop-daemon --start --quiet -u ${USHARE_USER:-root} \
65 --exec /usr/bin/ushare -- -D -i ${USHARE_IFACE} \
66 -n ${USHARE_NAME} ${USHARE_OPTS} ${USHARE_DIRS} \
67 ${ushare_port} \
68 ${ushare_telnet} ${ushare_telnet_port} \
69 ${ushare_web} \
70 ${ushare_xbox} \
71 ${ushare_dlna}
72 eend $?
73 }
74
75 stop() {
76 ebegin "Stopping uShare"
77 start-stop-daemon --stop --quiet --exec /usr/bin/ushare
78 eend $?
79 }

  ViewVC Help
Powered by ViewVC 1.1.20