Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/etc/rc.d Finish incomplete pullup (approved by fvdl):



details:   https://anonhg.NetBSD.org/src/rev/d71fd4b78dc0
branches:  netbsd-1-5
changeset: 489237:d71fd4b78dc0
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Aug 24 09:26:12 2000 +0000

description:
Finish incomplete pullup (approved by fvdl):

pull up rev 1.5:
        move guts of etc/rc.wscons -> etc/rc.d/wscons
approved: thorpej

diffstat:

 etc/rc.d/wscons |  123 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 117 insertions(+), 6 deletions(-)

diffs (142 lines):

diff -r 35ca19826365 -r d71fd4b78dc0 etc/rc.d/wscons
--- a/etc/rc.d/wscons   Thu Aug 24 09:19:29 2000 +0000
+++ b/etc/rc.d/wscons   Thu Aug 24 09:26:12 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: wscons,v 1.3.4.1 2000/08/09 19:09:49 lukem Exp $
+# $NetBSD: wscons,v 1.3.4.2 2000/08/24 09:26:12 tron Exp $
 #
 
 # PROVIDE: wscons
@@ -10,14 +10,125 @@
 
 name="wscons"
 start_precmd="checkyesno wscons"
-start_cmd="do_wscons"
+start_cmd="wscons_start"
 stop_cmd=":"
 
-do_wscons()
+wscons_start()
 {
-       if [ -f /etc/rc.wscons ]; then
-               . /etc/rc.wscons
-       fi
+       wscfg=/usr/sbin/wsconscfg
+       wsfld=/usr/sbin/wsfontload
+       config=/etc/wscons.conf
+       usage="Usage: wsconfig [-n] [-f configfile] [-font fontpgm] [-screen screenpgm]"
+       DOIT=
+
+       while [ $# -gt 0 ]; do
+               case $1 in
+                       -n)
+                               DOIT=echo
+                               ;;
+                       -f)
+                               config=$2
+                               shift
+                               ;;
+                       -font)
+                               wsfld=$2
+                               shift
+                               ;;
+                       -screen)
+                               wscfg=$2
+                               shift
+                               ;;
+                       *)
+                               echo $usage
+                               exit 1
+                               ;;
+               esac
+               shift
+       done
+
+
+       # 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)
+                               name=$arg1
+                               width=$arg2
+                               height=$arg3
+                               enc=$arg4
+                               file=$arg5
+                               cmd=$wsfld
+
+                               case $width in
+                                       -)
+                                               ;;
+                                       *)
+                                               cmd="$cmd -w $width"
+                                               ;;
+                               esac
+                               case $height in
+                                       -)
+                                               ;;
+                                       *)
+                                               cmd="$cmd -h $height"
+                                               ;;
+                               esac
+                               case $enc in
+                                       -)
+                                               ;;
+                                       *)
+                                               cmd="$cmd -e $enc"
+                                               ;;
+                               esac
+                               cmd="$cmd -N $name $file"
+                               eval $DOIT $cmd
+                               ;;
+                       screen)
+                               idx=$arg1
+                               scr=$arg2
+                               emul=$arg3
+                               cmd=$wscfg
+
+                               case $scr in
+                                       -)
+                                               ;;
+                                       *)
+                                               cmd="$cmd -t $scr"
+                                               ;;
+                               esac
+                               case $emul in
+                                       -)
+                                               ;;
+                                       *)
+                                               cmd="$cmd -e $emul"
+                                               ;;
+                               esac
+                               cmd="$cmd $idx"
+                               eval $DOIT $cmd
+                               ;;
+                       keyboard)
+                               kbd=$arg1
+                               cmd=$wscfg
+                               case $kbd in
+                                       -|auto)
+                                               cmd="$cmd -k"
+                                               ;;
+                                       *)
+                                               cmd="$cmd -k $kbd"
+                                               ;;
+                               esac
+                               eval $DOIT $cmd
+                               ;;
+                       mux)
+                               cmd="$wscfg -m $arg1"
+                               eval $DOIT $cmd
+                               ;;
+               esac
+       done ) < $config
 }
 
 load_rc_config $name



Home | Main Index | Thread Index | Old Index