From a12dbdc6c93a7d63591610378e3e570b7c7d2143 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sun, 2 Mar 2008 21:13:21 +0000 Subject: Don't check for root in prefix. --- init.d.NetBSD/ttys | 17 -------- init.d.NetBSD/ttys.in | 23 +++++++++++ init.d.NetBSD/wscons | 99 ----------------------------------------------- init.d.NetBSD/wscons.in | 100 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+), 116 deletions(-) delete mode 100644 init.d.NetBSD/ttys create mode 100644 init.d.NetBSD/ttys.in delete mode 100644 init.d.NetBSD/wscons create mode 100644 init.d.NetBSD/wscons.in (limited to 'init.d.NetBSD') diff --git a/init.d.NetBSD/ttys b/init.d.NetBSD/ttys deleted file mode 100644 index 59b66743..00000000 --- a/init.d.NetBSD/ttys +++ /dev/null @@ -1,17 +0,0 @@ -#!/sbin/runscript -# Copyright 2008 Roy Marples -# All rights reserved. Released under the 2-clause BSD license. - -start() -{ - ebegin "Setting tty flags" - ttyflags -a - eend $? || return $? - - if [ -c /dev/ttyp0 ]; then - chmod 666 /dev/tty[p-uw-zP-T][0-9a-zA-Z] - fi - if [ -c /dev/ttyv1 ]; then - chmod 666 /dev/ttyv[0-9a-zA-Z] - fi -} diff --git a/init.d.NetBSD/ttys.in b/init.d.NetBSD/ttys.in new file mode 100644 index 00000000..3e07de3a --- /dev/null +++ b/init.d.NetBSD/ttys.in @@ -0,0 +1,23 @@ +#!/sbin/runscript +# Copyright 2008 Roy Marples +# All rights reserved. Released under the 2-clause BSD license. + +depend() +{ + after fsck + keyword noprefix +} + +start() +{ + ebegin "Setting tty flags" + ttyflags -a + eend $? || return $? + + if [ -c /dev/ttyp0 ]; then + chmod 666 /dev/tty[p-uw-zP-T][0-9a-zA-Z] + fi + if [ -c /dev/ttyv1 ]; then + chmod 666 /dev/ttyv[0-9a-zA-Z] + fi +} diff --git a/init.d.NetBSD/wscons b/init.d.NetBSD/wscons deleted file mode 100644 index 7859f5fb..00000000 --- a/init.d.NetBSD/wscons +++ /dev/null @@ -1,99 +0,0 @@ -#!/sbin/runscript -# Copyright 2008 Roy Marples -# All rights reserved. Released under the 2-clause BSD license. - -depend() -{ - need localmount -} - -start() -{ - wscfg=/usr/sbin/wsconscfg - wsfld=/usr/sbin/wsfontload - wsctl=/sbin/wsconsctl - config=/etc/wscons.conf - - # args mean: - # screen idx scr emul - # font name width height enc file - while read type arg1 arg2 arg3 arg4 arg5; do - case "${type}" in - \#*|"") - continue - ;; - - font) - cmd=${wsfld} - [ "${arg2}" != "-" ] && cmd="${cmd} -w ${arg2}" - [ "${arg3}" != "-" ] && cmd="${cmd} -h ${arg3}" - [ "${arg4}" != "-" ] && cmd="${cmd} -e ${arg4}" - cmd="${cmd} -N ${arg1} ${arg5}" - eval "${cmd}" - ;; - - screen) - cmd=${wscfg} - [ "${arg2}" != "-" ] && cmd="${cmd} -t ${arg2}" - [ "${arg3}" != "-" ] && cmd="${cmd} -e ${arg3}" - cmd="${cmd} ${arg1}" - eval "${cmd}" - ;; - - keyboard) - cmd=${wscfg} - case "${arg1}" in - -|auto) - cmd="${cmd} -k" - ;; - *) - cmd="${cmd} -k ${arg1}" - ;; - esac - ${cmd} - ;; - - encoding) - eval ${wsctl} -w "\"encoding=${arg1}\"" - ;; - - mapfile) - local entry= - while read entry; do - case "${entry}" in - \#*|"") - continue - ;; - *) - cmd="${wsctl} -w \"map+=${entry}\"" - eval "${cmd} >/dev/null" - ;; - esac - done < "${arg1}" - ;; - - mux) - eval "${wscfg} -m ${arg1}" - ;; - - setvar) - case "${arg1}" in - keyboard) - cmd="${wsctl} -kw ${arg2}" - ;; - display) - cmd="${wsctl} -dw ${arg2}" - ;; - mouse) - cmd="${wsctl} -mw ${arg2}" - ;; - *) - cmd="${wsctl} -w ${arg1}" - ;; - esac - eval "${cmd}" - ;; - - esac - done < "${config}" -} diff --git a/init.d.NetBSD/wscons.in b/init.d.NetBSD/wscons.in new file mode 100644 index 00000000..6fee03d5 --- /dev/null +++ b/init.d.NetBSD/wscons.in @@ -0,0 +1,100 @@ +#!/sbin/runscript +# Copyright 2008 Roy Marples +# All rights reserved. Released under the 2-clause BSD license. + +depend() +{ + need localmount + keyword noprefix +} + +start() +{ + wscfg=/usr/sbin/wsconscfg + wsfld=/usr/sbin/wsfontload + wsctl=/sbin/wsconsctl + config=/etc/wscons.conf + + # args mean: + # screen idx scr emul + # font name width height enc file + while read type arg1 arg2 arg3 arg4 arg5; do + case "${type}" in + \#*|"") + continue + ;; + + font) + cmd=${wsfld} + [ "${arg2}" != "-" ] && cmd="${cmd} -w ${arg2}" + [ "${arg3}" != "-" ] && cmd="${cmd} -h ${arg3}" + [ "${arg4}" != "-" ] && cmd="${cmd} -e ${arg4}" + cmd="${cmd} -N ${arg1} ${arg5}" + eval "${cmd}" + ;; + + screen) + cmd=${wscfg} + [ "${arg2}" != "-" ] && cmd="${cmd} -t ${arg2}" + [ "${arg3}" != "-" ] && cmd="${cmd} -e ${arg3}" + cmd="${cmd} ${arg1}" + eval "${cmd}" + ;; + + keyboard) + cmd=${wscfg} + case "${arg1}" in + -|auto) + cmd="${cmd} -k" + ;; + *) + cmd="${cmd} -k ${arg1}" + ;; + esac + ${cmd} + ;; + + encoding) + eval ${wsctl} -w "\"encoding=${arg1}\"" + ;; + + mapfile) + local entry= + while read entry; do + case "${entry}" in + \#*|"") + continue + ;; + *) + cmd="${wsctl} -w \"map+=${entry}\"" + eval "${cmd} >/dev/null" + ;; + esac + done < "${arg1}" + ;; + + mux) + eval "${wscfg} -m ${arg1}" + ;; + + setvar) + case "${arg1}" in + keyboard) + cmd="${wsctl} -kw ${arg2}" + ;; + display) + cmd="${wsctl} -dw ${arg2}" + ;; + mouse) + cmd="${wsctl} -mw ${arg2}" + ;; + *) + cmd="${wsctl} -w ${arg1}" + ;; + esac + eval "${cmd}" + ;; + + esac + done < "${config}" +} -- cgit v1.2.3