[EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
>
>On 20020804 J.A. Magallon wrote:
>> Hi all...
>>
>> I have two little problem with current cooker initscripts.
>>
>> - /etc/sysconfig/network-scripts/network-functions::check_link_down() has
>>   a fixed timeout of 2 secs to wait the link getting up. I had to increase
>>   this to 3 o 4 to make my sis900 (eth on laptop) initalize correctly. With
>>   the default sleep, the card was reported as 'link down, check cable'.
>>   I will try to mess with bash and post a patch to turn it into a loop with a
>>   number of tries (10) for 'ip link set up' with 1 sec sleep in each.
>How 'bout this:
>        for (( try=0; try<10; try++))
>        do
>            if [ "$(ip link show $1 up)" ]; then
>                echo "Link is UP"
>                break
>            fi
>            echo "Link is DOWN, rising..."
>            ip link set $1 up &> /dev/null
>            sleep 1
>        done
>It works but is bash specific.
>Are initscripts supposed to run under plain sh ?? 

If they are, then they are all broken. Try installing ash and linking it as /bin/sh
instead of bash. Then, try and reboot. Good luck, you will have to reboot again with
init=/bin/bash and relink bash as /bin/sh!

IMHO, the scripts should either be fixed to work with any standard sh, or have their
hashbang changed from #!/bin/sh to #!/bin/bash

>If not, there could
>be much optimization and clearing, because bash let you do many things
>not used in standard scripts (like the above '&> x', instead of '>x 2>&1' )

IMHO, use bash-isms, as long as the script calls bash, and not sh.

Buchan


Reply via email to