blob: 931bc38eb1ba1dcf5df37bf7a2258694f40cb05b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
diff -Naur rp-pppoe-3.5.orig/scripts/adsl-setup.in rp-pppoe-3.5/scripts/adsl-setup.in
--- rp-pppoe-3.5.orig/scripts/adsl-setup.in 2002-07-08 17:38:24.000000000 +0300
+++ rp-pppoe-3.5/scripts/adsl-setup.in 2005-03-08 01:06:46.248252496 +0200
@@ -86,12 +86,16 @@
$ECHO "USER NAME"
$ECHO ""
$ECHO -n ">>> Enter your PPPoE user name (default $USER): "
- read U
+ read Uu
+
+ U=`echo $Uu | sed -e "s/&/\\\\\&/g"` ;
+
if [ "$U" = "" ] ; then
U="$USER"
fi
+
# Under Linux, "fix" the default interface if eth1 is not available
if test `uname -s` = "Linux" ; then
$IFCONFIG $ETH > /dev/null 2>&1 || ETH=eth0
@@ -221,7 +225,7 @@
$ECHO "** Summary of what you entered **"
$ECHO ""
$ECHO "Ethernet Interface: $E"
- $ECHO "User name: $U"
+ $ECHO "User name: $Uu"
if [ "$D" = "no" ] ; then
$ECHO "Activate-on-demand: No"
else
@@ -288,7 +292,12 @@
fi
# Some #$(*& ISP's use a slash in the user name...
-sed -e "s&^USER=.*&USER='$U'&" \
+for SEP in ':' ';' '/' '!' '|' '_' '-' '@' ; do
+ if [ "$U" = `echo $U | sed "sI${SEP}II"` ]; then
+ break;
+ fi
+done
+sed -e "s${SEP}^USER=.*${SEP}USER='$U'${SEP}"\
-e "s&^ETH=.*Ð='$E'&" \
-e "s&^PIDFILE=.*&PIDFILE=\"$VARRUN/\$CF_BASE-adsl.pid\"&" \
-e "s/^FIREWALL=.*/FIREWALL=$FIREWALL/" \
@@ -337,10 +346,10 @@
cp /dev/null /etc/ppp/chap-secrets-bak
fi
-egrep -v "^$U|^\"$U\"" /etc/ppp/pap-secrets-bak > /etc/ppp/pap-secrets
-$ECHO "\"$U\" * \"$PWD1\"" >> /etc/ppp/pap-secrets
-egrep -v "^$U|^\"$U\"" /etc/ppp/chap-secrets-bak > /etc/ppp/chap-secrets
-$ECHO "\"$U\" * \"$PWD1\"" >> /etc/ppp/chap-secrets
+egrep -v "^$Uu|^\"$Uu\"" /etc/ppp/pap-secrets-bak > /etc/ppp/pap-secrets
+$ECHO "\"$Uu\" * \"$PWD1\"" >> /etc/ppp/pap-secrets
+egrep -v "^$Uu|^\"$Uu\"" /etc/ppp/chap-secrets-bak > /etc/ppp/chap-secrets
+$ECHO "\"$Uu\" * \"$PWD1\"" >> /etc/ppp/chap-secrets
$ECHO ""
$ECHO ""
|