ඩයල් ඉන් සේවර් ස්ක්‍රිප්ට් එක

©Buddika 2004 - Released as GPL 2.0

Begin of Script _______>

#/bin/bash
#su -
#mkdir /root/dialin
echo "Please enter your path to Mgetty rpm : "
read mgpath
echo "Mgetty source path is" $mgpath
rpm -Uvh $mgpath
echo "Please enter your modem port (without /dev) :"
read mdname
echo "We are going to use modem on /dev/"$mdname
echo "debug 2" > /etc/mgetty+sendfax/mgetty.config
echo "port "$mdname >> /etc/mgetty+sendfax/mgetty.config
echo "Please enter speed of your modem [or 57600 for 56K modems]"
read mdspd
echo -e debug 6"\n"data-only y"\n"speed $mdspd >> /etc/mgetty+sendfax/mgetty.config
echo "We are going to use AutoPPP"
echo "/AutoPPP/ - - /etc/ppp/ppplogin debug" > /etc/mgetty+sendfax/login.config
chmod 600 /etc/mgetty+sendfax/login.config
echo S2:2345:respawn:/sbin/mgetty $mdname -D /dev/$mdname >> /etc/inittab
init q
echo "Please enter your Hostname ,may be:";hostname
read hostn
echo "Please enter your IP ,may be:";hostname -i
read hostip
#hostname $hostn
#hostname $hostip
echo -e lock"\n"-detach"\n"crtscts"\n"asyncmap 0"\n"modem"\n"ms-dns $hostip"\n"debug 6"\n"ns.$hostn:ppp0.$hostn"\n"idle 180 > /etc/ppp/options
echo -e mesg n"\n"stty -echo"\n"/usr/sbin/pppd silent auth -chap +pap login > /etc/ppp/ppplogin
chmod 744 /etc/ppp/ppplogin
echo -e lock"\n"-detach"\n"crtscts"\n"asyncmap 0"\n"modem"\n"ms-dns $hostip"\n"debug 6"\n"ns.$hostn:ppp0.$hostn"\n"idle 180 > /etc/ppp/options.$mdname
echo "* * "\"\"" 172.16.4.1" >> /etc/ppp/pap-secrets
chmod u+s /usr/sbin/pppd
echo $hostip" "$hostn" ns."$hostn" www."$hostn" mail."$hostn >> /etc/hosts
echo "172.16.4.1 ppp0 user modem user."$hostn" ppp0."$hostn" modem."$hostn >> /etc/hosts
echo -e NETWORKING=yes"\n"FORWARD_IPV4=yes"\n"HOSTNAME=$ho stn"\n"DOMAINNAME=$hostn > /etc/sysconfig/network
echo "Set up completed ! Have fun"
echo "User useradd & passwd to add new users"

Share:

1 comments