Files
Arch-R/packages/network/ppp/scripts/pppoe-setup
2010-06-17 08:44:38 +02:00

53 lines
948 B
Bash
Executable File

#!/bin/sh
echo "Adsl configure........."
while [ true ] ; do
echo ""
echo "USER NAME"
echo ""
printf "%s" ">>> Enter your PPPoE user name (default $user): "
read Uu
if [ "$Uu" = "" ] ; then
Uu="$user"
fi
U=`echo $Uu | sed -e "s/&/\\\\\&/g"`
while [ true ] ; do
echo ""
echo "PASSWORD"
echo ""
printf "%s" ">>> Please enter your PPPoE password: "
read PWD1
echo ""
printf "%s" ">>> Please re-enter your PPPoE password: "
read PWD2
echo ""
if [ "$PWD1" = "$PWD2" ] ; then
break
fi
printf "%s" ">>> Sorry, the passwords do not match. Try again? (y/n)"
read ANS
case "$ANS" in
N|No|NO|Non|n|no|non)
echo "OK, quitting. Bye."
exit 1
esac
done
echo "\"$Uu\" * \"$PWD1\"" > /storage/.config/chap-secrets
cp /storage/.config/chap-secrets /var/cache/
echo "\"$Uu\" * \"$PWD1\"" > /storage/.config/pap-secrets
cp /storage/.config/pap-secrets /var/cache/
exit 0
done