1 |
hd_brummy 09/05/02 13:11:44 |
2 |
|
3 |
Added: xxv.utf8-v4 |
4 |
Log: |
5 |
version bump; more detailed messages for utf-8 update on depended mysql db |
6 |
(Portage version: 2.1.6.11/cvs/Linux i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 www-misc/xxv/files/xxv.utf8-v4 |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-misc/xxv/files/xxv.utf8-v4?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-misc/xxv/files/xxv.utf8-v4?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: xxv.utf8-v4 |
15 |
=================================================================== |
16 |
#!/sbin/runscript |
17 |
# Copyright 1999-2009 Gentoo Foundation |
18 |
# Distributed under the terms of the GNU General Public License, v2 or later |
19 |
# $Header: /var/cvsroot/gentoo-x86/www-misc/xxv/files/xxv.utf8-v4,v 1.1 2009/05/02 13:11:44 hd_brummy Exp $ |
20 |
|
21 |
RUNAS_USER="vdr" |
22 |
|
23 |
# Set Verbose Level 0 -> 5 |
24 |
VERBOSE="1" |
25 |
|
26 |
depend() { |
27 |
need vdr |
28 |
} |
29 |
|
30 |
# some fixed Path |
31 |
CONFIGFILE="/etc/xxv/xxvd.cfg" |
32 |
PIDFILE="/var/run/xxv/xxvd.pid" |
33 |
XXV_BIN="/usr/bin/xxvd" |
34 |
LOGFILE="/var/log/xxv/xxvd.log" |
35 |
|
36 |
xxv_logger() { |
37 |
printf "\tXXV running as user: ${RUNAS_USER}\n" >> "${LOGFILE}" |
38 |
printf "\tVerbose Level: ${VERBOSE}\n" >> "${LOGFILE}" |
39 |
printf "\tYou can change this in xxv init script\n\n" >> "${LOGFILE}" |
40 |
} |
41 |
|
42 |
check_vdradmin() { |
43 |
|
44 |
# Check at first, is VDR-Admin running |
45 |
# Stopping, while running on same ports |
46 |
if [ -n "`netstat -anp | grep vdradmin | grep 8080`" ] ; then |
47 |
echo |
48 |
eerror "VDR-Admin will Stop at first now" |
49 |
eerror "vdradmin and xxv can not run on the same port" |
50 |
echo |
51 |
/etc/init.d/vdradmin stop |
52 |
fi |
53 |
} |
54 |
|
55 |
xxv_kill_pid() { |
56 |
|
57 |
# After unclear stop, xxvd.pid will not removed, fixed with next line |
58 |
if [ ! -x /etc/init.d/root ]; then |
59 |
[ -e ${PIDFILE} -a ! -L /var/lib/init.d/started/xxv ] |
60 |
rm ${PIDFILE} |
61 |
killall xxvd 2> /dev/null |
62 |
fi |
63 |
|
64 |
} |
65 |
|
66 |
xxv_kill_initfile() { |
67 |
|
68 |
# After unclear stop, init file in /var/lib/init.d/started/ still not removed |
69 |
|
70 |
if [ ! -x /etc/init.d/root ]; then |
71 |
[ -L /var/lib/init.d/started/xxv -a ! -e ${PIDFILE} ] |
72 |
rm /var/lib/init.d/started/xxv |
73 |
/etc/init.d/xxv zap |
74 |
killall xxvd 2> /dev/null |
75 |
fi |
76 |
|
77 |
} |
78 |
|
79 |
set_utf8_charset() { |
80 |
local capfile=/usr/share/vdr/capabilities.sh |
81 |
[ -e "${capfile}" ] && . ${capfile} |
82 |
if [ "${CAP_UTF8}" = "1" -o "${VDR_CAN_HANDLE_UTF8}" = "yes" ]; then |
83 |
# do not clean out utf8 |
84 |
XXV_UTF8="-utf8" |
85 |
printf "\txxv starting with utf-8 support\n" >> "${LOGFILE}" |
86 |
fi |
87 |
} |
88 |
|
89 |
start() { |
90 |
check_vdradmin |
91 |
xxv_logger |
92 |
set_utf8_charset |
93 |
|
94 |
ebegin "Start xxv" |
95 |
echo |
96 |
einfo "xxv running as user: ${RUNAS_USER}" |
97 |
einfo "Verbose Level: ${VERBOSE}" |
98 |
|
99 |
start-stop-daemon --nicelevel 15 --pidfile ${PIDFILE} --start -c ${RUNAS_USER} --exec ${XXV_BIN} -- \ |
100 |
${XXV_UTF8} -configfile=${CONFIGFILE} -verbose=${VERBOSE} -pidfile=${PIDFILE} |
101 |
eend $? |
102 |
} |
103 |
|
104 |
|
105 |
stop() { |
106 |
|
107 |
ebegin "Stopping xxvd" |
108 |
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} |
109 |
|
110 |
xxv_kill_pid |
111 |
xxv_kill_initfile |
112 |
|
113 |
eend $? |
114 |
} |
115 |
|
116 |
restart() { |
117 |
|
118 |
xxv_kill_pid |
119 |
xxv_kill_initfile |
120 |
|
121 |
|
122 |
svc_stop |
123 |
svc_start |
124 |
} |