1 1.1 lukem #!/bin/sh 2 1.1 lukem # 3 1.3.4.2 tron # $NetBSD: wscons,v 1.3.4.2 2000/08/24 09:26:12 tron Exp $ 4 1.1 lukem # 5 1.1 lukem 6 1.1 lukem # PROVIDE: wscons 7 1.3.4.1 lukem # REQUIRE: mountcritremote 8 1.1 lukem 9 1.1 lukem . /etc/rc.subr 10 1.1 lukem 11 1.1 lukem name="wscons" 12 1.2 veego start_precmd="checkyesno wscons" 13 1.3.4.2 tron start_cmd="wscons_start" 14 1.2 veego stop_cmd=":" 15 1.1 lukem 16 1.3.4.2 tron wscons_start() 17 1.1 lukem { 18 1.3.4.2 tron wscfg=/usr/sbin/wsconscfg 19 1.3.4.2 tron wsfld=/usr/sbin/wsfontload 20 1.3.4.2 tron config=/etc/wscons.conf 21 1.3.4.2 tron usage="Usage: wsconfig [-n] [-f configfile] [-font fontpgm] [-screen screenpgm]" 22 1.3.4.2 tron DOIT= 23 1.3.4.2 tron 24 1.3.4.2 tron while [ $# -gt 0 ]; do 25 1.3.4.2 tron case $1 in 26 1.3.4.2 tron -n) 27 1.3.4.2 tron DOIT=echo 28 1.3.4.2 tron ;; 29 1.3.4.2 tron -f) 30 1.3.4.2 tron config=$2 31 1.3.4.2 tron shift 32 1.3.4.2 tron ;; 33 1.3.4.2 tron -font) 34 1.3.4.2 tron wsfld=$2 35 1.3.4.2 tron shift 36 1.3.4.2 tron ;; 37 1.3.4.2 tron -screen) 38 1.3.4.2 tron wscfg=$2 39 1.3.4.2 tron shift 40 1.3.4.2 tron ;; 41 1.3.4.2 tron *) 42 1.3.4.2 tron echo $usage 43 1.3.4.2 tron exit 1 44 1.3.4.2 tron ;; 45 1.3.4.2 tron esac 46 1.3.4.2 tron shift 47 1.3.4.2 tron done 48 1.3.4.2 tron 49 1.3.4.2 tron 50 1.3.4.2 tron # args mean: 51 1.3.4.2 tron # screen idx scr emul 52 1.3.4.2 tron # font name width height enc file 53 1.3.4.2 tron ( while read type arg1 arg2 arg3 arg4 arg5; do 54 1.3.4.2 tron case "$type" in 55 1.3.4.2 tron \#*|"") 56 1.3.4.2 tron continue 57 1.3.4.2 tron ;; 58 1.3.4.2 tron font) 59 1.3.4.2 tron name=$arg1 60 1.3.4.2 tron width=$arg2 61 1.3.4.2 tron height=$arg3 62 1.3.4.2 tron enc=$arg4 63 1.3.4.2 tron file=$arg5 64 1.3.4.2 tron cmd=$wsfld 65 1.3.4.2 tron 66 1.3.4.2 tron case $width in 67 1.3.4.2 tron -) 68 1.3.4.2 tron ;; 69 1.3.4.2 tron *) 70 1.3.4.2 tron cmd="$cmd -w $width" 71 1.3.4.2 tron ;; 72 1.3.4.2 tron esac 73 1.3.4.2 tron case $height in 74 1.3.4.2 tron -) 75 1.3.4.2 tron ;; 76 1.3.4.2 tron *) 77 1.3.4.2 tron cmd="$cmd -h $height" 78 1.3.4.2 tron ;; 79 1.3.4.2 tron esac 80 1.3.4.2 tron case $enc in 81 1.3.4.2 tron -) 82 1.3.4.2 tron ;; 83 1.3.4.2 tron *) 84 1.3.4.2 tron cmd="$cmd -e $enc" 85 1.3.4.2 tron ;; 86 1.3.4.2 tron esac 87 1.3.4.2 tron cmd="$cmd -N $name $file" 88 1.3.4.2 tron eval $DOIT $cmd 89 1.3.4.2 tron ;; 90 1.3.4.2 tron screen) 91 1.3.4.2 tron idx=$arg1 92 1.3.4.2 tron scr=$arg2 93 1.3.4.2 tron emul=$arg3 94 1.3.4.2 tron cmd=$wscfg 95 1.3.4.2 tron 96 1.3.4.2 tron case $scr in 97 1.3.4.2 tron -) 98 1.3.4.2 tron ;; 99 1.3.4.2 tron *) 100 1.3.4.2 tron cmd="$cmd -t $scr" 101 1.3.4.2 tron ;; 102 1.3.4.2 tron esac 103 1.3.4.2 tron case $emul in 104 1.3.4.2 tron -) 105 1.3.4.2 tron ;; 106 1.3.4.2 tron *) 107 1.3.4.2 tron cmd="$cmd -e $emul" 108 1.3.4.2 tron ;; 109 1.3.4.2 tron esac 110 1.3.4.2 tron cmd="$cmd $idx" 111 1.3.4.2 tron eval $DOIT $cmd 112 1.3.4.2 tron ;; 113 1.3.4.2 tron keyboard) 114 1.3.4.2 tron kbd=$arg1 115 1.3.4.2 tron cmd=$wscfg 116 1.3.4.2 tron case $kbd in 117 1.3.4.2 tron -|auto) 118 1.3.4.2 tron cmd="$cmd -k" 119 1.3.4.2 tron ;; 120 1.3.4.2 tron *) 121 1.3.4.2 tron cmd="$cmd -k $kbd" 122 1.3.4.2 tron ;; 123 1.3.4.2 tron esac 124 1.3.4.2 tron eval $DOIT $cmd 125 1.3.4.2 tron ;; 126 1.3.4.2 tron mux) 127 1.3.4.2 tron cmd="$wscfg -m $arg1" 128 1.3.4.2 tron eval $DOIT $cmd 129 1.3.4.2 tron ;; 130 1.3.4.2 tron esac 131 1.3.4.2 tron done ) < $config 132 1.1 lukem } 133 1.1 lukem 134 1.3 lukem load_rc_config $name 135 1.1 lukem run_rc_command "$1" 136