2 # $FreeBSD: src/release/picobsd/dial/lang/dialup.en,v 1.5 1999/08/28 01:33:20 peter Exp $
5 echo "
\e[1m Default Domain Name
\e[m"
7 echo "Here you should enter your default Internet domain. If your"
8 echo "provider uses something like 'www.big.isp.com', this should"
9 echo "be most probably 'big.isp.com'."
11 echo "If you simply press enter here, you will have a 'mydomain.edu',"
12 echo "which is not the best idea, but may suffice for now..."
14 read -p "Please enter the default domain name: " domain
15 if [ "X${domain}" = "X" ]
18 echo "Fine, your domain will be 'mydomain.edu', but be aware"
19 echo "that it probably doesn't exist."
21 read -p "Press any key to continue." junk
25 echo "
\e[1m DNS Server Address
\e[m"
27 echo "Here you should enter the numeric address of your domain name"
28 echo "server. It is needed for resolving human-readable host names"
29 echo "(such as www.freebsd.org) to machine readable IP numbers. If"
30 echo "it's not set properly, you will have to use numeric IP addresses"
31 echo "when connecting to other hosts, which is highly inconvenient."
33 echo "If you simply press Enter here, we'll set it to one of root"
34 echo "DNS servers. This may not always work."
36 read -p "Please enter the DNS server address in form A.B.C.D: " dns
37 if [ "X${dns}" = "X" ]
40 echo "Fine, your DNS server will be 192.33.4.12, but be aware"
41 echo "that this may not always work ok."
43 read -p "Press any key to continue." junk
49 while [ "X${phone}" = "X" ]
52 echo "
\e[1m Phone Number
\e[m"
54 echo "Here you should enter the full phone number you normally"
55 echo "use to connect to your provider, with all necessary prefixes"
56 echo "attached, e.g.: 01122334455"
58 read -p "Please enter the phone number: " phone
63 while [ "X${dev}" = "X" ]
66 echo "
\e[1m Port Number
\e[m"
68 echo "Here you should enter the port number, to which your modem is"
69 echo "attached. REMEMBER: COM1 is port 0 in FreeBSD, COM2 - port 1,"
70 echo "and so on. You should enter only the number, not the full name"
73 read -p "Please enter the port number (0,1,2): " dev
78 while [ "X${speed}" = "X" ]
81 echo "
\e[1m Port Speed
\e[m"
83 echo "Here you should choose the serial port speed."
85 echo "NOTICE: port speed is NOT the same as modem speed - these are"
86 echo "different things. If your modem is capable of V.42 or MNP"
87 echo "compression, the actual speed of serial port should be set much"
88 echo "higher. E.g. for 14.4 kbps modem with compression you should"
89 echo "choose 38400, for 28.8 kbps modem with compression you should"
95 echo " 4. 38400 bps (14.4 kbps modem with compression)"
97 echo " 6. 115200 bps (28.8 kbps modem with compression)"
99 read -p "Please choose the port speed (1-6): " ans
120 read -p "
\aBad value! Press enter to continue..." junk
128 while [ "X${timo}" = "X" ]
131 echo "
\e[1m Idle Timeout
\e[m"
133 echo "Here you should enter timeout (in seconds). After this time, if"
134 echo "the connection is idle, it's disconnected (to save your money :-)"
136 read -p "Please enter the timeout value: " timo
141 while [ "X${user}" = "X" ]
144 echo "
\e[1m Login Name
\e[m"
146 echo "Here you should enter your login name that you normally use"
147 echo "to log in to your provider's terminal server."
149 read -p "Please enter your login name: " user
154 while [ "X${pass}" = "X" ]
157 echo "
\e[1m Password
\e[m"
159 echo "Here you enter the password that you use to log in to the"
160 echo "terminal server."
162 echo "
\e[31mWARNING: your password will be stored in readable form on the"
163 echo "floppy!!! If you don't like it... well, you must dial in manually."
164 echo "In that case abort this script (Ctrl-C). Otherwise, continue.
\e[37m"
167 read -p "Please enter your password: " pass
169 read -p "Enter again your password: " pass1
172 if [ "X${pass}" != "X${pass1}" ]
174 echo "
\aPasswords didn't match! Press Enter to continue..."
184 while [ "X${chat}" = "X" ]
186 echo "
\e[1m Type of Login Dialog
\e[m"
188 echo "What type of login dialog do you expect from the terminal server?"
190 echo "1)
\e[32m......login:
\e[37m ${user}"
191 echo "
\e[32m...password:
\e[37m ********"
192 echo "
\e[36m(terminal server starts PPP here)
\e[37m"
193 echo "2)
\e[32m......login:
\e[37m ${user}"
194 echo "
\e[32m...password:
\e[37m ********"
195 echo "
\e[32m...protocol:
\e[37m ppp"
196 echo "
\e[36m(terminal server starts PPP here)
\e[37m"
197 echo "3)
\e[32m......username:
\e[37m ${user}"
198 echo "
\e[32m......password:
\e[37m ********"
199 echo "
\e[36m(terminal server starts PPP here)
\e[37m"
200 echo "4)
\e[32m......username:
\e[37m ${user}"
201 echo "
\e[32m......password:
\e[37m ********"
202 echo "
\e[32mportX/..xxx...:
\e[37m ppp"
203 echo "
\e[36m(terminal server starts PPP here)
\e[37m"
204 echo "5)
\e[32mUse CHAP to log in.
\e[37m"
205 echo "6)
\e[32mUse PAP to log in.
\e[37m"
207 read -p "Choose 1,2,3,4,5 or 6: " chat
210 chat1="TIMEOUT 10 ogin:--ogin: ${user} word: \\\\P"
211 chat2="login/password"
214 chat1="TIMEOUT 10 ogin:--ogin: ${user} word: \\\\P otocol: ppp"
215 chat2="login/password/protocol"
218 chat1="TIMEOUT 10 ername:--ername: ${user} word: \\\\P"
219 chat2="username/password"
222 chat1="TIMEOUT 10 ername:--ername: ${user} word: \\\\P port ppp"
223 chat2="username/password/port"
231 *) echo "
\aBad value! Please choose 1,2,3 or 4."
240 # Main entry of the script
243 echo "
\e[1m Welcome to The Simplest PPP Configurator! :-)
\e[m"
245 echo " Your PPP is already preconfigured, so that you can dial manually."
246 echo "However, you probably noticed that it requires chatting with your modem"
247 echo "and logging in every time you want to connect. It's simple and it works,"
248 echo "but it's also annoying."
250 echo "This script will try to configure your PPP so that you can run it in"
251 echo "background (thus freeing the console), and log in automatically."
253 echo "If you want to continue, press
\e[1mEnter
\e[m, otherwise press
\e[1mCtrl-C
\e[m."
257 # Step through the options.
268 while [ "X${ans}" != "X" ]
272 echo "
\e[1m Ok. You assigned the following values:
\e[m"
274 echo " 1. Phone number: ${phone}"
275 echo " 2. Port number: cuaa${dev}"
276 echo " 3. Port speed: ${speed} baud"
277 echo " 4. Timeout: ${timo} s"
278 echo " 5. Login name: ${user}"
279 echo " 6. Password: ${pass}"
280 echo " 7. Chat pattern: ${chat} (${chat2})"
281 echo " 8. Default domain: ${domain}"
282 echo " DNS Server: ${dns}"
284 echo "If you're satisfied with these values, just press
\e[1mEnter
\e[m."
285 read -p "Otherwise, enter the number of the option you want to change (1-8): " ans
323 read -p "Unknown option: ${ans}. Press enter to continue..."
330 echo -n "Generating /etc/ppp/ppp.conf file..."
331 rm -f /etc/ppp/ppp.conf
332 cp /etc/ppp/ppp.conf.template /etc/ppp/ppp.conf
333 echo "" >>/etc/ppp/ppp.conf
334 echo "# This part was generated with $0" >>/etc/ppp/ppp.conf
335 echo "dialup:" >>/etc/ppp/ppp.conf
336 echo " set line /dev/cuaa${dev}" >>/etc/ppp/ppp.conf
337 echo " set speed ${speed}" >>/etc/ppp/ppp.conf
338 echo " set phone ${phone}" >>/etc/ppp/ppp.conf
339 echo " set authkey ${pass}" >>/etc/ppp/ppp.conf
340 echo " set timeout ${timo}" >>/etc/ppp/ppp.conf
341 if [ "X${chat1}" = "-" ]
343 echo " set authname ${user}" >>/etc/ppp/ppp.conf
345 echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf
347 echo " set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0" >>/etc/ppp/ppp.conf
350 echo -n "Generating /etc/resolv.conf..."
351 echo "# This file was generated with $0">/etc/resolv.conf
352 echo "domain ${domain}" >>/etc/resolv.conf
353 echo "nameserver ${dns}">>/etc/resolv.conf
354 echo "hostname=\"pico.${domain}\"">>/etc/rc.conf
359 echo "REMEMBER to run /stand/update! Otherwise these changes will be lost!"
361 echo "Please check the contents of /etc/ppp/ppp.conf, and edit it if"
362 echo "necessary. When you're satisfied with it, run ppp in background:"
364 echo "
\e[1mppp -background dialup
\e[m"
366 echo "Now, if you're sure that your /etc/ppp/ppp.conf file is ok (which is"
367 echo -n "probable :-) would you like to start the dialup connection now? (y/n) "
370 while [ "X${ans}" = "Xy" ]
373 if [ "X${opts}" = "X" ]
375 echo "We'll use the following arguments to 'ppp':"
377 echo " ppp -background dialup"
379 echo -n "Would you like to change them? (y/n) "
381 if [ "X${oo}" = "Xy" ]
383 read -p "Enter ppp arguments here: " opts
385 opts="-background dialup"
390 echo "Starting dialup connection. Wait until you see a 'PPP Enabled' message..."
396 echo -n "Hmmm... Command failed. Try again? (y/n) "
398 if [ "X${ans}" != "Xy" ]
401 echo "Try again later. Check also your config file (/etc/ppp/ppp.conf)"
406 echo "Congratulations! You're on-line now."