summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/monotone/files/monotone.initd')
-rwxr-xr-xdev-util/monotone/files/monotone.initd80
1 files changed, 0 insertions, 80 deletions
diff --git a/dev-util/monotone/files/monotone.initd b/dev-util/monotone/files/monotone.initd
deleted file mode 100755
index f31ad1c74f01..000000000000
--- a/dev-util/monotone/files/monotone.initd
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/sbin/runscript
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/dev-util/monotone/files/monotone.initd,v 1.1 2006/09/04 13:33:52 dragonheart Exp $
-
-opts="import"
-
-depend() {
- need net
-}
-
-# Substitute common default values
-MTN_KEY=${MTN_KEY:-monotone@`hostname --fqdn`}
-MTN_CONFDIR=${MTN_CONFDIR:-/etc/monotone}
-MTN_COMMON="--norc --confdir=${MTN_CONFDIR} \
- --keydir=${MTN_KEYDIR:-/var/lib/monotone/keys} \
- --db=${MTN_DB:-/var/lib/monotone/default.mtn} \
- --rcfile=${MTN_CONFDIR}/hooks.lua --log=/var/log/monotone/monotone.log"
- #--dump=$ERRORLOG
-MTN_PIDFILE="/var/run/monotone/monotone.pid"
-
-dbexists() {
- # Create the database if it doesn't exist
- if [ ! -e ${MTN_DB:-/var/lib/monotone/default.mtn} ]; then
- ebegin "Creating monotone database"
- start-stop-daemon --start \
- --chuid ${MTN_USER:-monotone}:${MTN_GROUP:-monotone} \
- --exec /usr/bin/mtn -- ${MTN_COMMON} db init
- eend $?
- fi
- if [ ! -e ${MTN_KEYDIR:-/var/lib/monotone/keys}/${MTN_KEY} ]; then
- ebegin "Creating monotone server keypair"
- export MTN_PWD=${RANDOM}
- yes "${MTN_PWD}" | \
- start-stop-daemon --start \
- --chuid ${MTN_USER:-monotone}:${MTN_GROUP:-monotone} \
- --exec /usr/bin/mtn -- ${MTN_COMMON} genkey ${MTN_KEY}
-
- eend $?
- # Update the password lua hook
- cat > ${MTN_CONFDIR}/passphrase.lua <<EOF
--- This file is automaticaly generated by the init scripts.
--- If you want to add custom hooks, edit ${MTN_CONFDIR}/hooks.lua
--- If you want to change the settings, please edit /etc/conf.d/monotone
-
-function get_passphrase(identity)
- if (identity == "${MTN_KEY}") then
- return "${MTN_PWD}"
- end
- return false
-end
-EOF
- fi
-}
-
-start() {
- dbexists
-
- ebegin "Starting monotone server"
- start-stop-daemon --start --background \
- --chuid ${MTN_USER:-monotone}:${MTN_GROUP:-monotone} \
- --exec /usr/bin/mtn -- ${MTN_COMMON} --pid-file=${MTN_PIDFILE} \
- --key=${MTN_KEY} --bind=${MTN_ADDRESS:-0.0.0.0} serve "*"
- eend $?
-}
-
-stop() {
- ebegin "Stopping monotone server"
- start-stop-daemon --stop --quiet --pidfile ${MTN_PIDFILE}
- eend $?
-}
-
-import() {
- dbexists
-
- # Read packets into the database
- einfo "Importing packets to monotone database"
- cat | /usr/bin/mtn ${MTN_COMMON} read
- eend $?
-}