root/lm-sensors/trunk/prog/pwm/pwmconfig @ 4288

Revision 4288, 16.7 KB (checked in by khali, 8 years ago)

Drop commented out code.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/bin/bash
2#
3# pwmconfig v0.7
4# Tests the pwm outputs of sensors and configures fancontrol
5#
6#    Warning!!! This program will stop your fans, one at a time,
7#    for approximately 5 seconds each!!!
8#    This may cause your processor temperature to rise!!!
9#    Verify that all fans are running at normal speed after this
10#    program has exited!!!
11#
12#    Copyright 2003-2005 The lm_sensors project
13#
14#    This program is free software; you can redistribute it and/or modify
15#    it under the terms of the GNU General Public License as published by
16#    the Free Software Foundation; either version 2 of the License, or
17#    (at your option) any later version.
18#
19#    This program is distributed in the hope that it will be useful,
20#    but WITHOUT ANY WARRANTY; without even the implied warranty of
21#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22#    GNU General Public License for more details.
23#
24#    You should have received a copy of the GNU General Public License
25#    along with this program; if not, write to the Free Software
26#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27#
28#
29echo 'This program will search your sensors for pulse width modulation (pwm)'
30echo 'controls, and test each one to see if it controls a fan on'
31echo 'your motherboard. Note that many motherboards do not have pwm'
32echo 'circuitry installed, even if your sensor chip supports pwm.'
33echo
34echo 'We will attempt to briefly stop each fan using the pwm controls.'
35echo 'The program will attempt to restore each fan to full speed'
36echo 'after testing. However, it is ** very important ** that you'
37echo 'physically verify that the fans have been to full speed'
38echo 'after the program has completed.'
39echo
40
41DELAY=5 # 3 seconds delay is too short for large fans, thus I increased it to 5
42MAX=255
43
44DIR=/proc/sys/dev/sensors
45if [ ! -d $DIR ]
46then
47        if [ -d "/sys/class/hwmon" ]
48        then
49                SYSFS=2
50                DIR="/sys/class/hwmon"
51        elif [ -d "/sys/bus/i2c/devices" ]
52        then
53                SYSFS=1
54                DIR="/sys/bus/i2c/devices"
55        else
56                echo $0: 'No sensors found! (modprobe sensor modules?)'
57                exit 1
58        fi     
59fi
60
61cd $DIR
62if [ "$SYSFS" = "2" ]
63then
64        PREFIX='hwmon*/device'
65else
66        PREFIX='*-*'
67fi
68DEVICES=`echo $PREFIX`
69if [ "$PREFIX" = "$DEVICES" ]
70then
71        echo $0: 'No sensors found! (modprobe sensor modules?)'
72        exit 1
73fi
74
75MATCH=$PREFIX/'pwm[1-9]'
76PWM=`echo $MATCH`
77if [ "$SYSFS" = "1" -a "$MATCH" = "$PWM" ]
78then
79        # Deprecated naming scheme (used in kernels 2.6.5 to 2.6.9)
80        MATCH=$PREFIX/'fan[1-9]_pwm'
81        PWM=`echo $MATCH`
82fi
83if [ "$MATCH" = "$PWM" ]
84then
85        echo $0: 'There are no pwm-capable sensor modules installed'
86        exit 1
87fi
88
89if [ -n "$SYSFS" ]
90then
91        MATCH=$PREFIX/'fan[1-9]_input'
92else
93        MATCH=$PREFIX/'fan[1-9]'
94fi
95FAN=`echo $MATCH`
96if [ "$MATCH" = "$FAN" ]
97then
98        echo $0: 'There are no fan-capable sensor modules installed'
99        exit 1
100fi
101
102# $1 = padding
103# Only works with Linux 2.6
104function print_devices()
105{
106        for device in $DEVICES
107        do
108                echo "$1$device is `cat $device/name`"
109        done
110}
111
112# $1 = pwm file name
113function pwmdisable()
114{
115        if [ -n "$SYSFS" ]
116        then
117                ENABLE=${1}_enable
118                # No enable file? Just set to max
119                if [ ! -f $ENABLE ]
120                then
121                        echo $MAX > $1
122                        return 0
123                fi
124
125                # Try pwmN_enable=0
126                echo 0 > $ENABLE 2> /dev/null
127                if [ "`cat $ENABLE`" -eq 0 ]
128                then
129                        # Success
130                        return 0
131                fi
132
133                # It didn't work, try pwmN_enable=1 pwmN=255
134                echo 1 > $ENABLE 2> /dev/null
135                echo $MAX > $1
136                if [ "`cat $ENABLE`" -eq 1 -a "`cat $1`" -ge 190 ]
137                then
138                        # Success
139                        return 0
140                fi
141
142                # Nothing worked
143                echo "$ENABLE stuck to `cat $ENABLE`" >&2
144                return 1
145        else
146                echo $MAX 0 > $1
147        fi
148}
149
150# $1 = pwm file name
151function pwmenable()
152{
153        if [ -n "$SYSFS" ]
154        then
155                ENABLE=${1}_enable
156                if [ -w $ENABLE ]
157                then
158                        echo 1 > $ENABLE 2> /dev/null
159                        if [ $? -ne 0 ]
160                        then
161                                return 1
162                        fi
163                fi
164                echo $MAX > $1
165        else
166                echo $MAX 1 > $1
167        fi
168}
169
170# $1 = pwm file name; $2 = pwm value 0-255
171function pwmset()
172{
173        echo $2 > $1
174}
175
176if [ -n "$SYSFS" ]
177then
178        echo 'Found the following devices:'
179        print_devices "   "
180        echo
181fi
182
183echo 'Found the following PWM controls:'
184for i in $PWM
185do
186        echo "   $i"
187        if [ -w $i ]
188        then
189                pwmdisable $i
190                if [ $? -ne 0 ]
191                then
192                        echo "Failed to set pwm$i to full speed" >&2
193                        echo "Something's wrong, check your fans!" >&2
194                        exit 1
195                fi
196        else
197                NOTROOT=1
198        fi
199done
200
201echo
202echo 'Found the following fan sensors:'
203for i in $FAN
204do
205        # this will return the first field if there's only one (sysfs)
206        S=`cat $i | cut -d' ' -f2`
207        if [ "$S" = "0" -o "$S" = "-1" ]
208        then
209                echo "   $i     current speed: 0 ... skipping!"
210        else
211                echo "   $i     current speed: $S RPM"
212                if [ "$GOODFAN" = "" ]
213                then
214                        GOODFAN=$i
215                        SPEEDS=$S
216                else
217                        GOODFAN="$GOODFAN $i"
218                        SPEEDS="$SPEEDS $S"
219                fi
220        fi
221done
222echo
223
224if [ "$GOODFAN" = "" ]
225then
226        echo 'There are no working fan sensors, all readings are 0.'
227        echo 'Make sure you have a 3-wire fan connected.'
228        echo 'You may also need to increase the fan divisors.'
229        echo 'See doc/fan-divisors for more information.'
230        exit 1
231fi
232
233if [ "$NOTROOT" = "1" ]
234then
235        echo 'As you are not root, we cannot write the PWM settings.'
236        echo 'Please run as root to continue.'
237        exit 1
238fi
239
240echo 'Warning!!! This program will stop your fans, one at a time,'
241echo "for approximately $DELAY seconds each!!!"
242echo 'This may cause your processor temperature to rise!!!'
243echo 'If you do not want to do this hit control-C now!!!'
244echo -n 'Hit return to continue: '
245read X
246echo
247
248PLOTTER=gnuplot
249STEP=15
250PDELAY=2
251
252function pwmdetail()
253{
254        P=$1
255        F=$2
256        PLOT=
257
258        type $PLOTTER > /dev/null 2>&1
259        if [ $? -eq 0 ]
260        then
261                echo -n "Would you like to generate a graphical plot using $PLOTTER (y)? "
262                read X
263                if [ "$X" = "y" -o "$X" = "Y" -o "$X" = "" ]
264                then
265                        PLOT=y         
266                fi
267        fi
268
269        if [ "$PLOT" = "y" ]
270        then
271                TMP1=`mktemp -t pwmtest1.XXXXXXXXXX` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
272                TMP2=`mktemp -t pwmtest2.XXXXXXXXXX` || { rm -f $TMP1 ; echo "$0: Cannot create temporary file" >&2; exit 1; }
273                echo "set xlabel \"PWM: $P\"" > $TMP1
274                echo "set ylabel \"FAN: $F (RPM)\"" >> $TMP1
275                echo 'set nokey' >> $TMP1
276                echo 'set xrange [0:255]' >> $TMP1
277                echo "plot \"$TMP2\" with lines" >> $TMP1
278                echo 'pause -1 "    Hit return to continue..."' >> $TMP1
279                > $TMP2
280        fi
281
282        let pwm=$MAX
283        pwmenable $P
284        while [ $pwm -ge 0 ]
285        do
286                pwmset $P $pwm 
287                sleep $PDELAY
288                if [ $? -ne 0 ]
289                then
290                        pwmdisable $P   
291                        echo '^C received, aborting...'
292                        rm -f $TMP1 $TMP2
293                        exit 1
294                fi             
295                # this will return the first field if there's only one (sysfs)
296                S=`cat $F | cut -d' ' -f2`
297                echo "    PWM $pwm FAN $S"
298                if [ "$PLOT" = "y" ]
299                then
300                        echo "$pwm $S" >> $TMP2
301                fi
302                if [ "$S" = "0" -o "$S" = "-1" ]
303                then
304                        pwmdisable $P   
305                        echo "    Fan Stopped at PWM = $pwm"
306                        if [ $pwm -eq $MAX ]
307                        then
308                                echo "    This fan appears to stop when the PWM is enabled;"
309                                echo "    perhaps the fan input shares a pin with the PWM output"
310                                echo "    on the sensor chip."
311                                echo "    You cannot control this fan with this PWM output."
312                                rm -f $TMP1 $TMP2
313                                echo
314                                return 0
315                        fi
316                        break
317                fi
318                let pwm=$pwm-$STEP
319        done
320        pwmdisable $P   
321        if [ "$PLOT" = "y" ]
322        then
323                $PLOTTER  $TMP1
324                rm -f $TMP1 $TMP2
325        fi
326        echo
327}
328
329for i in $PWM
330do
331        echo Testing pwm control $i ...
332        pwmenable $i
333        if [ $? -ne 0 ]
334        then
335                echo "Manual control mode not supported, skipping."
336                continue
337        fi
338        pwmset $i 0
339        sleep $DELAY
340        if [ $? -ne 0 ]
341        then
342                pwmdisable $i
343                echo '^C received, restoring PWM and aborting...'
344                exit 1
345        fi             
346        let pwmactivecount=0
347        let count=1
348        for j in $GOODFAN
349        do
350                OS=`echo $SPEEDS | cut -d' ' -f$count`
351                # this will return the first field if there's only one (sysfs)
352                S=`cat $j | cut -d' ' -f2`
353                echo "  $j ... speed was $OS now $S"
354                pwmdisable $i
355                let threshold=2*$OS/3
356                if [ $S -lt $threshold ]
357                then
358                        echo "    It appears that fan $j"
359                        echo "    is controlled by pwm $i"
360#
361# a PWM can control more than one fan....
362#
363                        if [ $pwmactivecount -eq 0 ]
364                        then
365                                let pwmactivecount=1
366                                pwmactive="$i ${pwmactive}"
367                                fanactive="$j ${fanactive}"
368                        else
369                                fanactive="$j+${fanactive}" #not supported yet by fancontrol
370                        fi
371                        sleep $DELAY
372                        if [ $? -ne 0 ]
373                        then
374                                echo '^C received, aborting...'
375                                exit 1
376                        fi             
377                        # this will return the first field if there's only one (sysfs)
378                        S=`cat $j | cut -d' ' -f2`
379                        if [ $S -lt $threshold ]
380                        then
381                                echo "    Fan $j has not returned to speed, please investigate!"
382                        else
383                                echo -n "Would you like to generate a detailed correlation (y)? "
384                                read X
385                                if [ "$X" = "y" -o "$X" = "Y" -o "$X" = "" ]
386                                then
387                                        pwmdetail $i $j
388                                fi
389                        fi
390                else
391                        echo "    no correlation"
392                fi
393                let count=count+1
394        done
395        echo
396        if [ "$pwmactivecount" = "0" ]
397        then
398                echo "No correlations were detected."
399                echo "There is either no fan connected to the output of $i,"
400                echo "or the connected fan has no rpm-signal connected to one of"
401                echo "the tested fan sensors. (Note: not all motherboards have"
402                echo "the pwm outputs connected to the fan connectors,"
403                echo "check out the hardware database on http://www.almico.com/forumindex.php)"
404                echo
405                echo -n "Did you see/hear a fan stopping during the above test (n)? "
406                read X
407                if [ "$X" = "y" -o "$X" = "Y" ]
408                then
409                        pwmactive="$i ${pwmactive}"
410                fi
411                echo
412        fi
413done
414
415
416echo 'Testing is complete.'
417echo 'Please verify that all fans have returned to their normal speed.'
418echo
419echo 'The fancontrol script can automatically respond to temperature changes'
420echo 'of your system by changing fanspeeds.'
421echo -n 'Do you want to set up its configuration file now (y)? '
422
423read X
424if [ "$X" = "n" -o "$X" = "N" ]
425then
426        exit
427fi
428
429if [ -n "$SYSFS" ]
430then
431        MATCH=$PREFIX/'temp[1-9]_input'
432else
433        MATCH=$PREFIX/'temp[1-9]'
434fi
435TEMPS=`echo $MATCH`
436if [ "$MATCH" = "$TEMPS" ]
437then
438        echo $0: 'There are no temperature-capable sensor modules installed'
439        exit 1
440fi
441
442function AskPath {
443        echo -n 'What should be the path to your fancontrol config file (/etc/fancontrol)? '
444
445        read X
446        if [ "$X" = "y" -o "$X" = "Y" -o "$X" = "" ]
447        then
448                X=/etc/fancontrol
449        fi
450        if [ -f $X ]
451        then
452                FCCONFIG=$X
453        else
454                echo -n "$X does not exist, shall I create it now (y)? "
455                read Y
456                if [ "$Y" = "y" -o "$Y" = "Y" -o "$Y" = "" ]
457                then
458                        touch $X
459                        chmod 0660 $X
460                        chown root.root $X
461                        FCCONFIG=$X
462                else
463                        AskPath
464                fi
465        fi
466}
467
468AskPath
469
470function LoadConfig {
471        echo "Loading configuration from $1 ..."
472        INTERVAL=`egrep '^INTERVAL=.*$' $1 | sed -e 's/INTERVAL=//g'`
473        FCTEMPS=`egrep '^FCTEMPS=.*$' $1 | sed -e 's/FCTEMPS=//g'`
474        FCFANS=`egrep '^FCFANS=.*$' $1 | sed -e 's/FCFANS=//g'`
475        MINTEMP=`egrep '^MINTEMP=.*$' $1 | sed -e 's/MINTEMP=//g'`
476        MAXTEMP=`egrep '^MAXTEMP=.*$' $1 | sed -e 's/MAXTEMP=//g'`
477        MINSTART=`egrep '^MINSTART=.*$' $1 | sed -e 's/MINSTART=//g'`
478        MINSTOP=`egrep '^MINSTOP=.*$' $1 | sed -e 's/MINSTOP=//g'`
479
480        # Check for configuration change
481        local item
482        for item in $FCFANS
483        do
484                if [ ! -f "`echo $item | sed -e 's/=.*$//'`" ]
485                then
486                        echo "Configuration appears to be outdated, discarded"
487                        FCTEMPS=""
488                        FCFANS=""
489                        MINTEMP=""
490                        MAXTEMP=""
491                        MINSTART=""
492                        MINSTOP=""
493                fi
494        done
495}
496
497LoadConfig $FCCONFIG
498
499function TestMinStart {
500        echo
501        echo 'Now we increase the PWM value in 10-unit-steps.'
502        echo 'Let the fan stop completely, then press return until the'
503        echo "fan starts spinning. Then enter 'y'."
504        echo 'We will use this value +20 as the starting speed.'
505        let fanok=0
506        let fanval=0
507        until [ "$fanok" = "1" ]
508        do
509                let fanval=fanval+10
510                if [ $fanval -gt 240 ] ; then let fanval=$MAX ; let fanok=1 ; fi
511                echo -n "Setting $pwms to $fanval..."
512                echo $fanval > $pwms
513                read FANTEST
514                if [ "$FANTEST" != "" ] ; then let fanok=1 ; fi
515        done
516        let fanval=fanval+20
517        if [ $fanval -gt 240 ] ; then let fanval=$MAX ; fi
518        echo "OK, using $fanval"
519        echo $MAX > $pwms
520}
521
522function TestMinStop {
523        echo
524        echo 'Now we decrease the PWM value in 10-unit-steps.'
525        echo 'Let the fan reach full speed, then press return until the'
526        echo "fan stops spinning. Then enter 'y'."
527        echo 'We will use this value +20 as the minimum speed.'
528        let fanok=0
529        let fanval=$MAX
530        until [ "$fanok" = "1" ]
531        do
532                let fanval=fanval-10
533                if [ $fanval -lt 0 ] ; then let fanval=0 ; let fanok=1 ; fi
534                echo -n "Setting $pwms to $fanval..."
535                echo $fanval > $pwms
536                read FANTEST
537                if [ "$FANTEST" != "" ] ; then let fanok=1 ; fi
538        done
539        let fanval=fanval+20
540        if [ $fanval -gt $MAX ] ; then let fanval=$MAX ; fi
541        echo "OK, using $fanval"
542        echo $MAX > $pwms
543}
544
545function SaveConfig {
546        echo
547        echo "Saving configuration to $FCCONFIG..."
548        tmpfile=`mktemp -t pwmcfg.XXXXXXXXXX` || { echo "$0: Cannot create temporary file" >&2; exit 1;  }
549        trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
550        egrep -v '(INTERVAL|FCTEMPS|FCFANS|MAXTEMP|MINTEMP|MINSTART|MINSTOP)' $FCCONFIG >$tmpfile
551        echo -e "INTERVAL=$INTERVAL\nFCTEMPS=$FCTEMPS\nFCFANS=$FCFANS\nMINTEMP=$MINTEMP\nMAXTEMP=$MAXTEMP\nMINSTART=$MINSTART\nMINSTOP=$MINSTOP" >>$tmpfile
552        mv $tmpfile $FCCONFIG
553        #check if file was written correctly
554        echo 'Configuration saved'
555}
556
557INTERVAL=10
558PS3='select (1-n): '
559DEFMINTEMP=0
560DEFMAXTEMP=60
561DEFMINSTART=150
562DEFMINSTOP=100
563
564#the section below has a high potential for usability improvements
565echo
566echo 'Select fan output to configure, or other action:'
567select pwms in $pwmactive "Change INTERVAL" "Just quit" "Save and quit" "Show configuration"; do
568        case $pwms in
569        "Change INTERVAL")
570                echo
571                echo "Current interval is $INTERVAL seconds."
572                echo -n "Enter the interval at which fancontrol should update PWM values (in s):"
573                read INTERVAL ;; #check user input here
574        "Just quit")
575                exit ;;
576        "Save and quit")
577                SaveConfig
578                exit ;;
579        "Show configuration")
580                echo
581                echo "Common Settings:"
582                echo "INTERVAL=$INTERVAL"
583                for pwmo in $pwmactive
584                do
585                        echo
586                        echo "Settings of ${pwmo}:"
587                        echo "  Depends on `echo $FCTEMPS |sed -e 's/ /\n/g' |egrep \"${pwmo}\" |sed -e 's/.*=//g'`"
588                        echo "  Controls `echo $FCFANS |sed -e 's/ /\n/g' |egrep \"${pwmo}\" |sed -e 's/.*=//g'`"
589                        echo "  MINTEMP=`echo $MINTEMP |sed -e \"s/ /\n/g\" |egrep \"${pwmo}\" |sed -e \"s/.*=//g\"`"
590                        echo "  MAXTEMP=`echo $MAXTEMP |sed -e \"s/ /\n/g\" |egrep \"${pwmo}\" |sed -e \"s/.*=//g\"`"
591                        echo "  MINSTART=`echo $MINSTART |sed -e \"s/ /\n/g\" |egrep \"${pwmo}\" |sed -e \"s/.*=//g\"`"
592                        echo "  MINSTOP=`echo $MINSTOP |sed -e \"s/ /\n/g\" |egrep \"${pwmo}\" |sed -e \"s/.*=//g\"`"
593                done
594                echo ;;
595
596        "`echo ${pwmactive} |sed -e 's/ /\n/g' | egrep \"${pwms}\"`" )
597                pwmsed=`echo ${pwms} | sed -e 's/\//\\\\\//g'` #escape / for sed
598                echo
599                if [ -n "$SYSFS" ]
600                then
601                        echo 'Devices:'
602                        print_devices ""
603                        echo
604                fi
605                echo 'Current temperature readings are as follows:'
606                for j in $TEMPS
607                do
608                        # this will return the first field if there's only one (sysfs)
609                        S=`cat $j | cut -d' ' -f3`
610                        if [ -n "$SYSFS" ]
611                        then
612                                let S="$S / 1000"
613                        fi
614                        echo "$j        $S"
615                done
616                FAN=`echo $fanactive|cut -d' ' -f$REPLY`
617                FCFANS="`echo $FCFANS | sed -e "s/${pwmsed}[^ ]* *//g\"` ${pwms}=$FAN"
618                echo
619                echo "Select a temperature sensor as source for ${pwms}:"
620                select tempss in $TEMPS "None (Do not affect this PWM output)"; do
621                        if [ "$tempss" = "None (Do not affect this PWM output)" ]
622                        then
623                       
624                                break;
625                        else
626                                if [ "$FCTEMPS" = "" ]
627                                then
628                                        FCTEMPS="${pwms}=${tempss}"
629                                else
630                                        FCTEMPS="`echo $FCTEMPS | sed -e "s/${pwmsed}[^ ]* *//g\"` ${pwms}=${tempss}"
631                                fi
632                        fi
633                        echo
634                        echo 'Enter the low temperature (C)'
635                        echo -n "at which the fan should be switched off ($DEFMINTEMP): "
636                        read XMT
637                        if [ "$XMT" = "" ]
638                        then
639                                XMT=$DEFMINTEMP
640                        fi
641                        if [ "$MINTEMP" = "" ]
642                        then
643                                MINTEMP="${pwms}=${XMT}"
644                        else
645                                MINTEMP="`echo $MINTEMP | sed -e \"s/${pwmsed}[^ ]* *//g\"` ${pwms}=${XMT}"
646                        fi
647                        echo
648                        echo 'Enter the high temperature (C)'
649                        echo -n "at which the fan should be switched to full speed ($DEFMAXTEMP): "
650                        read XMT
651                        if [ "$XMT" = "" ]
652                        then
653                                XMT=$DEFMAXTEMP
654                        fi
655                        if [ "$MAXTEMP" = "" ]
656                        then
657                                MAXTEMP="${pwms}=${XMT}"
658                        else
659                                MAXTEMP="`echo $MAXTEMP | sed -e \"s/${pwmsed}[^ ]* *//g\"` ${pwms}=${XMT}"
660                        fi
661                        echo
662                        echo "Enter the minimum PWM value (0-$MAX)"
663                        echo -n "at which the fan STARTS spinning (press t to test) ($DEFMINSTART): "
664                        read XMV
665                        if [ "$XMV" = "" ]
666                        then
667                                XMV=$DEFMINSTART
668                        fi
669                        if [ "$XMV" = "t" -o "$XMV" = "T" ]
670                        then
671                                TestMinStart
672                                XMV=$fanval
673                        fi
674                        if [ "$MINSTART" = "" ]
675                        then
676                                MINSTART="${pwms}=${XMV}"
677                        else
678                                MINSTART="`echo $MINSTART | sed -e \"s/${pwmsed}[^ ]* *//g\"` ${pwms}=${XMV}"
679                        fi
680                        echo
681                        echo "Enter the minimum PWM value (0-$MAX)"
682                        echo -n "at which the fan STOPS spinning (press t to test) ($DEFMINSTOP): "
683                        read XMV
684                        if [ "$XMV" = "" ]
685                        then
686                                XMV=$DEFMINSTOP
687                        fi
688                        if [ "$XMV" = "t" -o "$XMV" = "T" ]
689                        then
690                                TestMinStop
691                                XMV=$fanval
692                        fi
693                        if [ "$MINSTOP" = "" ]
694                        then
695                                MINSTOP="${pwms}=${XMV}"
696                        else
697                                MINSTOP="`echo $MINSTOP | sed -e \"s/${pwmsed}[^ ]* *//g\"` ${pwms}=${XMV}"
698                        fi
699                        echo
700                        break;
701                done ;;
702       
703        *)
704                grep $pwm
705
706                echo "No such option. Enter a number." ;;
707        esac
708done
Note: See TracBrowser for help on using the browser.