Move /etc/conf.d/rc to /etc/rc.conf.
Lowercase all configurable variables, non configurations remain uppercase. Replace rc_env_bool with rc_yesno. Split localmount info procfs (Linux) and dumpon, savecore (BSD)
This commit is contained in:
@@ -23,14 +23,15 @@
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
|
||||
name=${SVCNAME##*.}
|
||||
if [ -n "${name}" -a "${name}" != "moused" ] ; then
|
||||
device=/dev/"${name}"
|
||||
pidfile=/var/run/moused-"${name}".pid
|
||||
mouse=${SVCNAME##*.}
|
||||
if [ -n "${name}" -a "${mouse}" != "moused" ] ; then
|
||||
moused_device=/dev/"${mouse}"
|
||||
pidfile=/var/run/moused-"${mouse}".pid
|
||||
else
|
||||
name=
|
||||
pidfile=/var/run/moused.pid
|
||||
fi
|
||||
name="Console Mouse Daemon"
|
||||
[ -n "${moused_device}" ] && name="${name} (${moused_device})"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
@@ -38,45 +39,38 @@ depend() {
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting the Console Mouse Daemon" "${name}"
|
||||
ebegin "Starting ${name}"
|
||||
|
||||
if [ -z "${device}" ] ; then
|
||||
if [ -z "${moused_device}" ] ; then
|
||||
local dev=
|
||||
for dev in /dev/psm[0-9]* /dev/ums[0-9]* ; do
|
||||
[ -e "${dev}" ] || continue
|
||||
[ -e /var/run/moused-$(basename "${dev}").pid ] && continue
|
||||
device=${dev}
|
||||
moused_device=${dev}
|
||||
eindent
|
||||
einfo "Using mouse on ${device}"
|
||||
einfo "Using mouse on ${moused_device}"
|
||||
eoutdent
|
||||
break
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -z "${device}" ] ; then
|
||||
if [ -z "${moused_device}" ] ; then
|
||||
eend 1 "No mouse device found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
start-stop-daemon --start --exec /usr/sbin/moused \
|
||||
--pidfile "${pidfile}" \
|
||||
-- ${MOUSED_ARGS} -p "${device}" -I "${pidfile}"
|
||||
-- ${moused_args} -p "${moused_device}" -I "${pidfile}"
|
||||
local retval=$?
|
||||
|
||||
[ -n "${MOUSE_CHAR_START}" ] && MOUSE_CHAR_START="-M ${MOUSE_CHAR_START}"
|
||||
local ttyv=
|
||||
for ttyv in /dev/ttyv*; do
|
||||
vidcontrol < "${ttyv}" ${MOUSE_CHAR_START} -m on
|
||||
vidcontrol < "${ttyv}" -m on
|
||||
: $((retval+= $?))
|
||||
done
|
||||
|
||||
eend ${retval} "Failed to start moused"
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping the Console Mouse Daemon ${name}"
|
||||
start-stop-daemon --quiet --stop --pidfile "${pidfile}"
|
||||
eend $? "Failed to stop moused"
|
||||
}
|
||||
|
||||
# vim: set ts=4 :
|
||||
|
||||
Reference in New Issue
Block a user