Error in /etc/rc2.d/S95dial

Bug #109969 reported by Vincenzo Consales
2
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Undecided
Unassigned

Bug Description

One of the scripts located in rc2.d (S95dial) at the startup give me these 3 lines of errors:

line 5: while[[0 -lt 40]]: command not found
line 6: syntax error near unexpected token `do'
line 6: `do'

this is the file:

#!/bin/bash
modprobe ppp_generic
modprobe pppoatm
count=0
while[[$((count++)) -lt 40]]
do
sync=$(dmesg|grep 'ADSL line is up')
if[!-z "$sync"]
then
pppd call speedtch
exit 0
fi
sleep 1
done
echo "Firmware non caricato"

Revision history for this message
Vincenzo Consales (aquarius987) wrote :

I use Ubuntu Feisty, upgraded from edgy and this script seems to activate ADSL connection for my Speedtouch modem, infact the command i use to connect is pppd call speedtch

Revision history for this message
Ralph Janke (txwikinger) wrote :

Thanks for your bug report.

Try to change the line with the while command to this:

while [[ $((count++)) -lt 40 ]]

There should be a 'space' before and after '[[' and before ']]'

Please check if it works then. Is this the original file how it was installed ?

Thanks

Revision history for this message
Vincenzo Consales (aquarius987) wrote :

Ok.now works...there was an error in line 8 too, the same type of the error in line 5 but i correct it.
Maybe was my fault, but now i remember that is a script found on a guide on internet (i don't remember exactly where, there are some webpages related to S95dial).

The correct version of the file now it is:

#!/bin/bash
modprobe ppp_generic
modprobe pppoatm
count=0
while [[ $((count++)) -lt 40 ]]
do
sync=$(dmesg|grep 'ADSL line is up')
if [ ! -z "$sync" ]
then
pppd call speedtch
exit 0
fi
sleep 1
done
echo "Firmware non caricato"

Revision history for this message
Ralph Janke (txwikinger) wrote :

Did I understand you right, that the script did not come with any package from ubuntu?

If your problem is resolved now, do you agree that I can close the bug report?

Thanks

Revision history for this message
Vincenzo Consales (aquarius987) wrote :

Yes, you can close the bug report.
My error was to think that this script was in a package of ubuntu but now i remember that i put this script manually in /etc/init.d.
Sorry if i post this error as a bug report, but when i posted it i didn't remember this detail. However, thanks a lot for your help.
Bye

Revision history for this message
Ralph Janke (txwikinger) wrote :

Closed in agreement with reporter.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.