summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2012-12-16 14:43:05 +0100
committerMartin Väth <martin@mvath.de>2015-10-11 10:48:34 +0200
commit7f81c26aea1613d3a0eeb58b9eaa8cb6c5ff0b44 (patch)
treedff755ee404d326bdc6f3d2e4e0141f41b0423f2 /net-dialup/martian-modem/files/martian-modem.init.d
parentBump less. Update checksums (diff)
downloadmv-7f81c26aea1613d3a0eeb58b9eaa8cb6c5ff0b44.tar.gz
mv-7f81c26aea1613d3a0eeb58b9eaa8cb6c5ff0b44.tar.bz2
mv-7f81c26aea1613d3a0eeb58b9eaa8cb6c5ff0b44.zip
Rename martian->martian-modem and update from tree. Bump squash_dir, duckduckgo
Diffstat (limited to 'net-dialup/martian-modem/files/martian-modem.init.d')
-rw-r--r--net-dialup/martian-modem/files/martian-modem.init.d50
1 files changed, 50 insertions, 0 deletions
diff --git a/net-dialup/martian-modem/files/martian-modem.init.d b/net-dialup/martian-modem/files/martian-modem.init.d
new file mode 100644
index 00000000..3c5b8561
--- /dev/null
+++ b/net-dialup/martian-modem/files/martian-modem.init.d
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/martian-modem/files/martian-modem.init.d,v 1.1 2012/12/15 16:41:36 pacho Exp $
+
+daemon=/usr/sbin/martian_modem
+description="Initscript to run the userspace daemon for winmodems supported by martian-modem driver"
+
+: ${device:=${DEVICE:-/dev/ttySM0}}
+: ${logfile:=${LOGFILE:-/var/log/martian-modem.log}}
+: ${user:=${USER:-nobody}}
+: ${group:=${GROUP:-dialout}}
+: ${debug_level:=${DEBUG_LEVEL:-1}}
+: ${use_syslog:=${USE_SYSLOG:-YES}}
+pidfile=/var/run/${SVCNAME}.pid
+
+depend() {
+ need localmount
+ [ "${use_syslog}" = "YES" ] && use syslog
+}
+
+start() {
+ if [ -e /proc/modules ] ; then
+ local modem=
+ for modem in /dev/modem /dev/ttySM[0-9]* ; do
+ [ -e "${modem}" ] && break
+ done
+ fi
+ if [ ! -e "${modem}" ] ; then
+ modprobe martian-dev || eerror $? "Error loading martian-dev module"
+ fi
+
+ if ! yesno "${use_syslog}" ; then
+ martian_opts="${MARTIAN_OPTS} --log=${logfile}"
+ else
+ martian_opts="${MARTIAN_OPTS} --syslog"
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec ${daemon} --user ${user}:${group} \
+ --pidfile ${pidfile} --make-pidfile --background \
+ -- ${martian_opts} --debug=${debug_level} ${device}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile ${pidfile}
+ eend $?
+}