summaryrefslogtreecommitdiff
path: root/app-text/calibre/files/calibre-server.init
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-03-31 11:52:17 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-03-31 11:52:17 +0100
commit87c113356046f966304f910e49b5adacd60aa863 (patch)
tree3442fac5b29a5f9e7774e4074da728565a5191a0 /app-text/calibre/files/calibre-server.init
parent89f85ed278aede2f109b3e38f4b92def53fe204a (diff)
app-text/calibre : drop our ebuild
Diffstat (limited to 'app-text/calibre/files/calibre-server.init')
-rw-r--r--app-text/calibre/files/calibre-server.init58
1 files changed, 0 insertions, 58 deletions
diff --git a/app-text/calibre/files/calibre-server.init b/app-text/calibre/files/calibre-server.init
deleted file mode 100644
index 2f905424..00000000
--- a/app-text/calibre/files/calibre-server.init
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License, v2 or later
-
-depend() {
- need net
- need localmount
- after bootmisc
-}
-
-checkconfig() {
- if [ "${CALIBRE_USER}" = "" -o "${CALIBRE_USER}" = "root" ] ; then
- eerror "Please edit /etc/conf.d/calibre-server"
- eerror "You have to specify a user to run calibre-server as, as we will not run it as root!"
- eerror "Modify CALIBRE_USER to your needs (you can also add a group, after a colon)"
- return 1
- fi
- if ! getent passwd "${CALIBRE_USER%:*}" >/dev/null ; then
- eerror "Please edit /etc/conf.d/calibre-server"
- eerror "Your user has to exist!"
- return 1
- fi
- if [ "${CALIBRE_USER%:*}" != "${CALIBRE_USER}" ] ; then
- if ! getent group "${CALIBRE_USER#*:}" >/dev/null ; then
- eerror "Please edit /etc/conf.d/calibre-server"
- eerror "Your group has to exist too!"
- return 1
- fi
- fi
- if [ "${CALIBRE_LIBRARY}" = "" ] ; then
- CALIBRE_USER_HOME=$(getent passwd "${CALIBRE_USER%:*}" | cut -d ':' -f 6)
- CALIBRE_LIBRARY="${CALIBRE_USER_HOME}/Calibre Library"
- fi
- if [ ! -d "${CALIBRE_LIBRARY}" ] ; then
- eerror "Please edit /etc/conf.d/calibre-server"
- eerror "The Calibre library, '${CALIBRE_LIBRARY},' does not exist."
- eerror "Please modify CALIBRE_LIBRARY to point to a valid library."
- return 1
- fi
- return 0
-}
-
-start() {
- checkconfig || return $?
- local pidfile=/var/run/calibre-server.pid
- ebegin "Starting calibre-server"
- start-stop-daemon --user "${CALIBRE_USER}" \
- --pidfile "${pidfile}" --make-pidfile --background --exec /usr/bin/calibre-server \
- -- --with-library "${CALIBRE_LIBRARY}" ${CALIBRE_OPTS}
- eend $?
-}
-
-stop() {
- ebegin "Stopping calibre-server"
- start-stop-daemon --stop --user "${CALIBRE_USER}" \
- --pidfile /var/run/calibre-server.pid
- eend $?
-}