diff options
author | abial <abial@FreeBSD.org> | 1999-01-19 23:09:15 +0000 |
---|---|---|
committer | abial <abial@FreeBSD.org> | 1999-01-19 23:09:15 +0000 |
commit | 1f5891c7340db4e2880fa5a636f5d2eafa37b642 (patch) | |
tree | d06b5e263a6026946affa61ebaa8b1d9429aaaa5 /release/picobsd | |
parent | 2c5cd6fab177998355310a350b7fac3f008b1c12 (diff) | |
download | FreeBSD-src-1f5891c7340db4e2880fa5a636f5d2eafa37b642.zip FreeBSD-src-1f5891c7340db4e2880fa5a636f5d2eafa37b642.tar.gz |
Emulate getpass behaviour when asking for user's password.
Add ability to use PAP/CHAP authentication in auto-generated ppp.conf.
Let users edit ppp arguments before the first run.
Diffstat (limited to 'release/picobsd')
-rwxr-xr-x | release/picobsd/dial/lang/dialup.en | 54 | ||||
-rwxr-xr-x | release/picobsd/dial/lang/dialup.pl | 51 |
2 files changed, 95 insertions, 10 deletions
diff --git a/release/picobsd/dial/lang/dialup.en b/release/picobsd/dial/lang/dialup.en index 918c670..23b5d8e 100755 --- a/release/picobsd/dial/lang/dialup.en +++ b/release/picobsd/dial/lang/dialup.en @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: dialup.en,v 1.3 1998/08/07 19:29:57 abial Exp $ +# $Id: dialup.en,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $ set_resolv() { echo "[H[J" echo "[1m Default Domain Name[m" @@ -163,7 +163,19 @@ do echo "floppy!!! If you don't like it... well, you must dial in manually." echo "In that case abort this script (Ctrl-C). Otherwise, continue.[37m" echo "" + stty -echo read -p "Please enter your password: " pass + echo "" + read -p "Enter again your password: " pass1 + stty echo + echo "" + if [ "X${pass}" != "X${pass1}" ] + then + echo "Passwords didn't match! Press Enter to continue..." + read junk + pass="" + set_password + fi done } @@ -178,22 +190,21 @@ do echo "1) [32m......login:[37m ${user}" echo " [32m...password:[37m ********" echo " [36m(terminal server starts PPP here)[37m" - echo "" echo "2) [32m......login:[37m ${user}" echo " [32m...password:[37m ********" echo " [32m...protocol:[37m ppp" echo " [36m(terminal server starts PPP here)[37m" - echo "" echo "3) [32m......username:[37m ${user}" echo " [32m......password:[37m ********" echo " [36m(terminal server starts PPP here)[37m" - echo "" echo "4) [32m......username:[37m ${user}" echo " [32m......password:[37m ********" echo " [32mportX/..xxx...:[37m ppp" echo " [36m(terminal server starts PPP here)[37m" + echo "5) [32mUse CHAP to log in.[37m" + echo "6) [32mUse PAP to log in.[37m" echo "" - read -p "Choose 1,2,3 or 4: " chat + read -p "Choose 1,2,3,4,5 or 6: " chat case ${chat} in 1) chat1="TIMEOUT 10 ogin:--ogin: ${user} word: \\\\P" @@ -211,6 +222,12 @@ do chat1="TIMEOUT 10 ername:--ername: ${user} word: \\\\P port ppp" chat2="username/password/port" ;; + 5) chat1="-" + chat2="CHAP" + ;; + 6) chat1="-" + chat2="PAP" + ;; *) echo "Bad value! Please choose 1,2,3 or 4." echo "" unset chat @@ -321,7 +338,12 @@ echo " set speed ${speed}" >>/etc/ppp/ppp.conf echo " set phone ${phone}" >>/etc/ppp/ppp.conf echo " set authkey ${pass}" >>/etc/ppp/ppp.conf echo " set timeout ${timo}" >>/etc/ppp/ppp.conf -echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf +if [ "X${chat1}" = "-" ] +then + echo " set authname ${user}" >>/etc/ppp/ppp.conf +else + echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf +fi 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 echo " Done." @@ -344,12 +366,30 @@ echo "" echo "Now, if you're sure that your /etc/ppp/ppp.conf file is ok (which is" echo -n "probable :-) would you like to start the dialup connection now? (y/n) " read ans +opts="" while [ "X${ans}" = "Xy" ] do echo "[H[J" + if [ "X${opts}" = "X" ] + then + echo "We'll use the following arguments to 'ppp':" + echo "" + echo " ppp -background dialup" + echo " + echo -n "Would you like to change them? (y/n) " + read oo + if [ "X${oo}" = "Xy" ] + then + read -p "Enter ppp arguments here: " opts + else + opts="-background dialup" + fi + echo "" + echo "" + fi echo "Starting dialup connection. Wait until you see a 'PPP Enabled' message..." echo "" - ppp -background dialup + ppp ${opts} if [ "X$?" != "X0" ] then echo "" diff --git a/release/picobsd/dial/lang/dialup.pl b/release/picobsd/dial/lang/dialup.pl index 3d7dcf5..2d65e84 100755 --- a/release/picobsd/dial/lang/dialup.pl +++ b/release/picobsd/dial/lang/dialup.pl @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: dialup.pl,v 1.4 1998/08/10 19:07:52 abial Exp $ +# $Id: dialup.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $ set_resolv() { echo "[H[J" echo "[1m Domyślna Nazwa Domeny[m" @@ -162,7 +162,19 @@ do echo "ręcznie, tak jak dotychczas. W tym przypadku przerwij ten skrypt" echo "przez Ctrl-C.[37m" echo "" + stty -echo read -p "Podaj swoje hasło: " pass + echo "" + read -p "Podaj powtórnie swoje hasło: " pass1 + stty echo + echo "" + if [ "X${pass}" != "X${pass1}" ] + then + echo "Hasła nie pasują do siebie. Naciśnij Enter..." + pass="" + read junk + set_pass + fi done } @@ -188,7 +200,11 @@ do echo " [32mportX/..xxx...:[37m ppp" echo " [36m(tutaj startuje PPP)[37m" echo "" - read -p "Wybierz 1,2 lub 3: " chat + echo "4) [32mZastosuj CHAP[37m" + echo "" + echo "5) [32mZastosuj PAP[37m" + echo "" + read -p "Wybierz 1,2,3,4 lub 5: " chat case ${chat} in 1) chat1="TIMEOUT 10 ogin:--ogin: ${user} word: \\\\P" @@ -202,6 +218,12 @@ do chat1="TIMEOUT 10 ername:--ername: ${user} word: \\\\P port ppp" chat2="NASK - username/password/port" ;; + 4) chat1="-" + chat2="CHAP" + ;; + 5) chat1="-" + chat2="PAP" + ;; *) echo "Zła wartość! Musisz wybrać 1,2 lub 3." echo "" unset chat @@ -315,7 +337,12 @@ echo " set line /dev/cuaa${dev}" >>/etc/ppp/ppp.conf echo " set phone ${phone}" >>/etc/ppp/ppp.conf echo " set authkey ${pass}" >>/etc/ppp/ppp.conf echo " set timeout ${timo}" >>/etc/ppp/ppp.conf -echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf +if [ "X${chat1}" = "-" ] +then + echo "set authname ${user}" >>/etc/ppp/ppp.conf +else + echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf +fi 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 echo " Zrobione." @@ -339,9 +366,27 @@ echo "" echo "Ok. Jeśli Twój plik /etc/ppp/ppp.conf jest prawidłowy (co jest dosyć" echo -n "prawdopodobne :-), czy chcesz teraz uruchomić połączenie dialup? (t/n) " read ans +opts="" while [ "X${ans}" = "Xt" ] do echo "[H[J" + if [ "X${opts}" = "X" ] + then + echo "Wystartujemy 'ppp' z poniższymi opcjami:" + echo "" + echo " ppp -background dialup" + echo " + echo -n "Czy chcesz je zmienic?? (t/n) " + read oo + if [ "X${oo}" = "Xt" ] + then + read -p "Podaj opcje ppp: " opts + else + opts="-background dialup" + fi + echo "" + echo "" + fi echo "Uruchamiam połączenie dialup. Proszę czekać dopóki nie pojawi się" echo "komunikat 'PPP Enabled'..." echo "" |