Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a fresh install of Fedora Core 2 (default desktop) and I have been unable to use my dial up connection with it. I have made posts about it in the past, [url]here is the main one.
I've given up trying to get wvdial to work, but I found this dialing script in another post here:
Code:
~# cat ppp-test.sh
#!/bin/sh
#
# The info behind the equal signal must not contain spaces
#
REMOTEHOST=myisp.com.au # your ISP domain name
TELEPHONE=123456789 # your ISP phone number
ACCOUNT=myname # your account name on your ISP
PASSWORD=mypassword # your password
DEVICE=/dev/ttyS1 # modem port
SPEED=115200 # modem speed
#
[ ! -d /etc/ppp ] && mkdir /etc/ppp
SECRET=`echo \"$ACCOUNT\" \"$REMOTEHOST\" \"$PASSWORD\"`
if [ ! -e /etc/ppp/pap-secrets ] || [ `egrep -c "$SECRET" /etc/ppp/pap-secrets` -eq 0 ]
then
echo "$SECRET" >>/etc/ppp/pap-secrets
fi
if [ ! -e /etc/ppp/chap-secrets ] || [ `egrep -c "$SECRET" /etc/ppp/chap-secrets` -eq 0 ]
then
echo "$SECRET" >>/etc/ppp/chap-secrets
fi
exec /usr/sbin/pppd \
lock \
modem \
crtscts \
$DEVICE \
115200 \
kdebug 0 \
noauth \
noipdefault \
defaultroute \
ipcp-accept-local \
ipcp-accept-remote \
usepeerdns \
name $ACCOUNT \
remotename $REMOTEHOST \
connect " \
/usr/sbin/chat -v \
TIMEOUT 3 \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' '\rAT' \
'OK-+++\c-OK' 'AT&F1M1L0X4' \
TIMEOUT 45 \
OK ATX4 \
OK ATD${TIPDISC}${TELEPHONE} \
CONNECT '
I saved it as “dialup” made it executable, and ran it as root but get the following errors:
./dialup: line 1: ~#: command not found
./dialup: line 50: syntax error: unexpected end of file
Strange since it's only 49 lines long, but it keeps adding a blank line anyway. Can somebody tell me how I can resolve these errors and perhaps finally get online with Fedora?
Thanks for the help so far, but its only half solved. The first error is gone, but even with the exit statement I get the "./dialup: line 50: syntax error: unexpected end of file" error, any more ideas?
I didn't delete any lines, all I did was add the line "exit 0" to the end. The reason it says line 50 is because I copied the error from my post rather than the terminal, just got lazy. It's the last line anyway.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
What editor did you use? Reason for my question is Microsoft, of course .
*nix needs only one of <CR/LF> (Carriage Return / Line Feed of the typewriters of olden), µsoft both. Find out what your editor inserts when you hit <Enter> and change it if necessary or use another editor -- maybe this is causing your problem...
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
I don't know your system. So.
Code:
#!/bin/sh
means "This is a script -- for any shell you might want to use". Just to be sure try
Code:
#!/bin/bash
This is not portable but might clear the problem. (Google asked for "linux bash syntax error: unexpected end of file" comes up with mostly syntax errors concerning the if statement. You might want to experiment here further...).
Hi,
It seems like you have missed the semi colon(;) after the if statement. Just try adding the semi-colon and see whether it works. Usually i have encountered these kind of errors when i have screwed up something with the if statement. Just try this one ok.
Three common errors can occur when using the if statement:
• Omitting the semicolon (;) before the then statement in the single line form.
• Using else if or elsif instead of elif.
• Omitting the then statement when an elif statement is used.
• Writing if instead of fi at the end of an if statement.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.