2 # $FreeBSD: src/release/picobsd/dial/lang/dialup.en,v 1.5 1999/08/28 01:33:20 peter Exp $
3 # $DragonFly: src/release/picobsd/dial/lang/Attic/dialup.en,v 1.2 2003/06/17 04:27:20 dillon Exp $
6 echo "
\e[1m Default Domain Name
\e[m"
8 echo "Here you should enter your default Internet domain. If your"
9 echo "provider uses something like 'www.big.isp.com', this should"
10 echo "be most probably 'big.isp.com'."
12 echo "If you simply press enter here, you will have a 'mydomain.edu',"
13 echo "which is not the best idea, but may suffice for now..."
15 read -p "Please enter the default domain name: " domain
16 if [ "X${domain}" = "X" ]
19 echo "Fine, your domain will be 'mydomain.edu', but be aware"
20 echo "that it probably doesn't exist."
22 read -p "Press any key to continue." junk
26 echo "
\e[1m DNS Server Address
\e[m"
28 echo "Here you should enter the numeric address of your domain name"
29 echo "server. It is needed for resolving human-readable host names"
30 echo "(such as www.freebsd.org) to machine readable IP numbers. If"
31 echo "it's not set properly, you will have to use numeric IP addresses"
32 echo "when connecting to other hosts, which is highly inconvenient."
34 echo "If you simply press Enter here, we'll set it to one of root"
35 echo "DNS servers. This may not always work."
37 read -p "Please enter the DNS server address in form A.B.C.D: " dns
38 if [ "X${dns}" = "X" ]
41 echo "Fine, your DNS server will be 192.33.4.12, but be aware"
42 echo "that this may not always work ok."
44 read -p "Press any key to continue." junk
50 while [ "X${phone}" = "X" ]
53 echo "
\e[1m Phone Number
\e[m"
55 echo "Here you should enter the full phone number you normally"
56 echo "use to connect to your provider, with all necessary prefixes"
57 echo "attached, e.g.: 01122334455"
59 read -p "Please enter the phone number: " phone
64 while [ "X${dev}" = "X" ]
67 echo "
\e[1m Port Number
\e[m"
69 echo "Here you should enter the port number, to which your modem is"
70 echo "attached. REMEMBER: COM1 is port 0 in FreeBSD, COM2 - port 1,"
71 echo "and so on. You should enter only the number, not the full name"
74 read -p "Please enter the port number (0,1,2): " dev
79 while [ "X${speed}" = "X" ]
82 echo "
\e[1m Port Speed
\e[m"
84 echo "Here you should choose the serial port speed."
86 echo "NOTICE: port speed is NOT the same as modem speed - these are"
87 echo "different things. If your modem is capable of V.42 or MNP"
88 echo "compression, the actual speed of serial port should be set much"
89 echo "higher. E.g. for 14.4 kbps modem with compression you should"
90 echo "choose 38400, for 28.8 kbps modem with compression you should"
96 echo " 4. 38400 bps (14.4 kbps modem with compression)"
98 echo " 6. 115200 bps (28.8 kbps modem with compression)"
100 read -p "Please choose the port speed (1-6): " ans
121 read -p "
\aBad value! Press enter to continue..." junk
129 while [ "X${timo}" = "X" ]
132 echo "
\e[1m Idle Timeout
\e[m"
134 echo "Here you should enter timeout (in seconds). After this time, if"
135 echo "the connection is idle, it's disconnected (to save your money :-)"
137 read -p "Please enter the timeout value: " timo
142 while [ "X${user}" = "X" ]
145 echo "
\e[1m Login Name
\e[m"
147 echo "Here you should enter your login name that you normally use"
148 echo "to log in to your provider's terminal server."
150 read -p "Please enter your login name: " user
155 while [ "X${pass}" = "X" ]
158 echo "
\e[1m Password
\e[m"
160 echo "Here you enter the password that you use to log in to the"
161 echo "terminal server."
163 echo "
\e[31mWARNING: your password will be stored in readable form on the"
164 echo "floppy!!! If you don't like it... well, you must dial in manually."
165 echo "In that case abort this script (Ctrl-C). Otherwise, continue.
\e[37m"
168 read -p "Please enter your password: " pass
170 read -p "Enter again your password: " pass1
173 if [ "X${pass}" != "X${pass1}" ]
175 echo "
\aPasswords didn't match! Press Enter to continue..."
185 while [ "X${chat}" = "X" ]
187 echo "
\e[1m Type of Login Dialog
\e[m"
189 echo "What type of login dialog do you expect from the terminal server?"
191 echo "1)
\e[32m......login:
\e[37m ${user}"
192 echo "
\e[32m...password:
\e[37m ********"
193 echo "
\e[36m(terminal server starts PPP here)
\e[37m"
194 echo "2)
\e[32m......login:
\e[37m ${user}"
195 echo "
\e[32m...password:
\e[37m ********"
196 echo "
\e[32m...protocol:
\e[37m ppp"
197 echo "
\e[36m(terminal server starts PPP here)
\e[37m"
198 echo "3)
\e[32m......username:
\e[37m ${user}"
199 echo "
\e[32m......password:
\e[37m ********"
200 echo "
\e[36m(terminal server starts PPP here)
\e[37m"
201 echo "4)
\e[32m......username:
\e[37m ${user}"
202 echo "
\e[32m......password:
\e[37m ********"
203 echo "
\e[32mportX/..xxx...:
\e[37m ppp"
204 echo "
\e[36m(terminal server starts PPP here)
\e[37m"
205 echo "5)
\e[32mUse CHAP to log in.
\e[37m"
206 echo "6)
\e[32mUse PAP to log in.
\e[37m"
208 read -p "Choose 1,2,3,4,5 or 6: " chat
211 chat1="TIMEOUT 10 ogin:--ogin: ${user} word: \\\\P"
212 chat2="login/password"
215 chat1="TIMEOUT 10 ogin:--ogin: ${user} word: \\\\P otocol: ppp"
216 chat2="login/password/protocol"
219 chat1="TIMEOUT 10 ername:--ername: ${user} word: \\\\P"
220 chat2="username/password"
223 chat1="TIMEOUT 10 ername:--ername: ${user} word: \\\\P port ppp"
224 chat2="username/password/port"
232 *) echo "
\aBad value! Please choose 1,2,3 or 4."
241 # Main entry of the script
244 echo "
\e[1m Welcome to The Simplest PPP Configurator! :-)
\e[m"
246 echo " Your PPP is already preconfigured, so that you can dial manually."
247 echo "However, you probably noticed that it requires chatting with your modem"
248 echo "and logging in every time you want to connect. It's simple and it works,"
249 echo "but it's also annoying."
251 echo "This script will try to configure your PPP so that you can run it in"
252 echo "background (thus freeing the console), and log in automatically."
254 echo "If you want to continue, press
\e[1mEnter
\e[m, otherwise press
\e[1mCtrl-C
\e[m."
258 # Step through the options.
269 while [ "X${ans}" != "X" ]
273 echo "
\e[1m Ok. You assigned the following values:
\e[m"
275 echo " 1. Phone number: ${phone}"
276 echo " 2. Port number: cuaa${dev}"
277 echo " 3. Port speed: ${speed} baud"
278 echo " 4. Timeout: ${timo} s"
279 echo " 5. Login name: ${user}"
280 echo " 6. Password: ${pass}"
281 echo " 7. Chat pattern: ${chat} (${chat2})"
282 echo " 8. Default domain: ${domain}"
283 echo " DNS Server: ${dns}"
285 echo "If you're satisfied with these values, just press
\e[1mEnter
\e[m."
286 read -p "Otherwise, enter the number of the option you want to change (1-8): " ans
324 read -p "Unknown option: ${ans}. Press enter to continue..."
331 echo -n "Generating /etc/ppp/ppp.conf file..."
332 rm -f /etc/ppp/ppp.conf
333 cp /etc/ppp/ppp.conf.template /etc/ppp/ppp.conf
334 echo "" >>/etc/ppp/ppp.conf
335 echo "# This part was generated with $0" >>/etc/ppp/ppp.conf
336 echo "dialup:" >>/etc/ppp/ppp.conf
337 echo " set line /dev/cuaa${dev}" >>/etc/ppp/ppp.conf
338 echo " set speed ${speed}" >>/etc/ppp/ppp.conf
339 echo " set phone ${phone}" >>/etc/ppp/ppp.conf
340 echo " set authkey ${pass}" >>/etc/ppp/ppp.conf
341 echo " set timeout ${timo}" >>/etc/ppp/ppp.conf
342 if [ "X${chat1}" = "-" ]
344 echo " set authname ${user}" >>/etc/ppp/ppp.conf
346 echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf
348 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
351 echo -n "Generating /etc/resolv.conf..."
352 echo "# This file was generated with $0">/etc/resolv.conf
353 echo "domain ${domain}" >>/etc/resolv.conf
354 echo "nameserver ${dns}">>/etc/resolv.conf
355 echo "hostname=\"pico.${domain}\"">>/etc/rc.conf
360 echo "REMEMBER to run /stand/update! Otherwise these changes will be lost!"
362 echo "Please check the contents of /etc/ppp/ppp.conf, and edit it if"
363 echo "necessary. When you're satisfied with it, run ppp in background:"
365 echo "
\e[1mppp -background dialup
\e[m"
367 echo "Now, if you're sure that your /etc/ppp/ppp.conf file is ok (which is"
368 echo -n "probable :-) would you like to start the dialup connection now? (y/n) "
371 while [ "X${ans}" = "Xy" ]
374 if [ "X${opts}" = "X" ]
376 echo "We'll use the following arguments to 'ppp':"
378 echo " ppp -background dialup"
380 echo -n "Would you like to change them? (y/n) "
382 if [ "X${oo}" = "Xy" ]
384 read -p "Enter ppp arguments here: " opts
386 opts="-background dialup"
391 echo "Starting dialup connection. Wait until you see a 'PPP Enabled' message..."
397 echo -n "Hmmm... Command failed. Try again? (y/n) "
399 if [ "X${ans}" != "Xy" ]
402 echo "Try again later. Check also your config file (/etc/ppp/ppp.conf)"
407 echo "Congratulations! You're on-line now."