Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 358152 Details for
Bug 483786
net-nntp/sabnzbd: Improved init script for SABnzbd with fixes
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
New sabnzbd init script
sabnzbd (text/plain), 1.90 KB, created by
eponymous
on 2013-09-07 11:13:42 UTC
(
hide
)
Description:
New sabnzbd init script
Filename:
MIME Type:
Creator:
eponymous
Created:
2013-09-07 11:13:42 UTC
Size:
1.90 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2013 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 > >RUNDIR=/var/run/sabnzbd > >depend() { > need net >} > >get_var() { > > echo $(sed -n '/\[misc]/,/'$1'/ s/'$1' = \([[:alnum:].]\+\)/\1/p' ${SABNZBD_CONFIGFILE}) >} > >get_port() { > > [[ $(get_var 'enable_https') == 1 ]] && echo $(get_var 'https_port') || echo $(get_var 'port') >} > >get_addr() { > > local host=$(get_var 'host') > local port=$(get_port) > local protocol > > [[ ${host} == "0.0.0.0" ]] && host=localhost > [[ $(get_var 'enable_https') == 1 ]] && protocol="https" || protocol="http" > > echo ${protocol}://${host}:${port} > >} > >get_pidfile() { > > local port=$(get_port) > echo "${RUNDIR}/sabnzbd-${port}.pid" >} > >start() { > ebegin "Starting SABnzbd" > > checkpath -q -d -o ${SABNZBD_USER}:${SABNZBD_GROUP} -m 0770 "${RUNDIR}" > > start-stop-daemon \ > --quiet \ > --start \ > --user ${SABNZBD_USER} \ > --group ${SABNZBD_GROUP} \ > --name sabnzbd \ > --background \ > --pidfile $(get_pidfile) \ > --exec /usr/bin/sabnzbd \ > -- \ > --config-file ${SABNZBD_CONFIGFILE} \ > --logging ${SABNZBD_LOGGING} \ > --daemon \ > --pid ${RUNDIR} > > eend $? >} > > >stop() { > local api_key=$(get_var 'api_key') > local addr=$(get_addr) > local pidfile=$(get_pidfile) > local rc > > ebegin "Stopping SABnzbd" > > einfo "Attempting web-based shutdown @ ${addr}" > > # SABnzbd will return "ok" if shutdown is successful > rc=$(/usr/bin/curl -k -s "${addr}/sabnzbd/api?mode=shutdown&apikey=${api_key}") > [[ ${rc} == "ok" ]] && rc=0 || rc=1 > > if [ ${rc} -eq 1 ]; then > einfo "Falling back to SIGTERM, this may not work if you restarted via the web interface" > start-stop-daemon \ > --stop \ > --pidfile ${pidfile} \ > --retry SIGTERM/1/SIGKILL/5 > rc=$? > fi > > eend ${rc} >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 483786
:
357960
|
357962
|
358016
|
358020
|
358152
|
358154
|
358276
|
358278
|
358284
|
358286
|
358294
|
358296
|
358602
|
358604
|
360536
|
360558
|
360560
|
360600