#!/bin/sh 
# 
# ppp_setup  V1.2
#
#   PPP setup script 
#   Written by David Ohayon, Test eng. Department 
#   Mar-2000: Support for AIX 4.3.3, Ido Regev
#   Mar-2001: Support for en4 - en6, Ido Regev
#   May-2002: Recreate /home/ppp directory after cold start, Ido Regev
#  
#   This Script will do the following:  
#   1.    Add a link control for PPP. 
#   2.    Add an IP configuration for PPP. 
#   3.    Activate automatic startup of PPP daemons. 
#   4.    Add scippp host entry to the /etc/hosts file if necessary. 
#   5.    Enable ip forwarding ( in file /etc/rc.net ). 
#   6.    Add the scippp host to the arp table. 
#   7.    Add a user named ppp , group uucp. 
#   8.    Change the /etc/inittab file to enable respawning of getty after session completion.   
# 
#   Activation : 
# 
#  ppp_setup  <Modem assigned IP number> 
#    
#  Where : 
#  Brisque IP number is the IP number of the Brisque which The modem is attached to. 
#   
#  Modem assined IP number is the IP which is dedicated for the PPP connection and will be  
#  the IP number of the remote host after PPP connection is setup. 
# 
#  en0, en1, en2, en3, en4, en5, en6 OR fi0 are optional parameters to force configuration to a particular  
#  ethernet interface. If omitted, the Script will try to find out automatically   
#  the system configuration, and set it up correctly. 
# 
 if [ $# -ne 1 ]; then 
     echo "Usage: makeppp <Modem assigned IP number> "  
     exit 1 
 fi 
chmod +x $SCI_SCRIPTS/RemoteTools/AddToScript
chmod +x $SCI_SCRIPTS/RemoteTools/FindSubnet
# ido .....................................................
oslevel=`oslevel`
os1=`echo "$oslevel" | awk -F "." '{print $1}'"`
os2=`echo "$oslevel" | awk -F "." '{print $2}'"`
os3=`echo "$oslevel" | awk -F "." '{print $3}'"`
osmajor="$os1$os2$os3"
if  [ $osmajor -ge 431 ] ; 
then
	echo "oslevel = $oslevel; >= 431"
else
	echo "oslevel = $oslevel; <  431"
fi
# .................................................... ido
ModemIp=$1
# ido .....................................................
# old version     Interface0=`netstat -i | grep en0`
# old version     Interface1=`netstat -i | grep en1`
Interface0=`netstat -I en0 | grep en0`
Interface1=`netstat -I en1 | grep en1`
Interface2=`netstat -I fi0 | grep fi0`
Interface3=`netstat -I en2 | grep en2`
Interface4=`netstat -I en3 | grep en3`
Interface5=`netstat -I en4 | grep en4`
Interface6=`netstat -I en5 | grep en5`
Interface7=`netstat -I en6 | grep en6`
# .................................................... ido
if [ "$Interface0" = "" ] && [ "$Interface1" = "" ] && [ "$Interface2" = "" ] && [ "$Interface3" = "" ] && [ "$Interface4" = "" ] && [ "$Interface5" = "" ] && [ "$Interface6" = "" ] && [ "$Interface7" = "" ]; 
then
 echo "No Interfaces where found. Please make sure that the network is configured and up."
 exit 1
fi
# Changed by Ronit 9.4.2000 ( Support for all IP Classes )
if [ "$Interface0" != "" ];
then
         LocalBrisqueIp0=`ifconfig en0 | grep inet | awk '{print $2}'`
	 NetMask0=`ifconfig en0 | grep inet | awk '{print $4}'`
	 BrisqueDomain0=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp0 $NetMask0 | awk '{print $1}'`
	 LastAdrsInDomain0=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp0 $NetMask0 | awk '{print $2}'`
	 ModemDomain0=`$SCI_SCRIPTS/RemoteTools/FindSubnet $ModemIp $NetMask0 | awk '{print $1}'`	 
fi
#
if [ "$Interface1" != "" ];
then
	 LocalBrisqueIp1=`ifconfig en1 | grep inet | awk '{print $2}'`
	 NetMask1=`ifconfig en1 | grep inet | awk '{print $4}'`
	 BrisqueDomain1=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp1 $NetMask1 | awk '{print $1}'`
	 LastAdrsInDomain1=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp1 $NetMask1 | awk '{print $2}'`
	 ModemDomain1=`$SCI_SCRIPTS/RemoteTools/FindSubnet $ModemIp $NetMask1 | awk '{print $1}'`
fi
#
if [ "$Interface2" != "" ];
then
	 LocalBrisqueIp2=`ifconfig fi0 | grep inet | awk '{print $2}'`
	 NetMask2=`ifconfig fi0 | grep inet | awk '{print $4}'`
	 BrisqueDomain2=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp2 $NetMask2 | awk '{print $1}'`
	 LastAdrsInDomain2=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp2 $NetMask2 | awk '{print $2}'`
	 ModemDomain2=`$SCI_SCRIPTS/RemoteTools/FindSubnet $ModemIp $NetMask2 | awk '{print $1}'`
fi
#
if [ "$Interface3" != "" ];
then
	 LocalBrisqueIp3=`ifconfig en2 | grep inet | awk '{print $2}'`
	 NetMask3=`ifconfig en2 | grep inet | awk '{print $4}'`
	 BrisqueDomain3=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp3 $NetMask3 | awk '{print $1}'`
	 LastAdrsInDomain3=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp3 $NetMask3 | awk '{print $2}'`
	 ModemDomain3=`$SCI_SCRIPTS/RemoteTools/FindSubnet $ModemIp $NetMask3 | awk '{print $1}'`
fi
#
if [ "$Interface4" != "" ];
then
	 LocalBrisqueIp4=`ifconfig en3 | grep inet | awk '{print $2}'`
	 NetMask4=`ifconfig en3 | grep inet | awk '{print $4}'`
	 BrisqueDomain4=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp4 $NetMask4 | awk '{print $1}'`
	 LastAdrsInDomain4=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp4 $NetMask4 | awk '{print $2}'`
	 ModemDomain4=`$SCI_SCRIPTS/RemoteTools/FindSubnet $ModemIp $NetMask4 | awk '{print $1}'`
fi
#
if [ "$Interface5" != "" ];
then
	 LocalBrisqueIp5=`ifconfig en4 | grep inet | awk '{print $2}'`
	 NetMask5=`ifconfig en4 | grep inet | awk '{print $4}'`
	 BrisqueDomain5=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp4 $NetMask5 | awk '{print $1}'`
	 LastAdrsInDomain5=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp5 $NetMask5 | awk '{print $2}'`
	 ModemDomain5=`$SCI_SCRIPTS/RemoteTools/FindSubnet $ModemIp $NetMask5 | awk '{print $1}'`
fi
#
if [ "$Interface6" != "" ];
then
	 LocalBrisqueIp6=`ifconfig en5 | grep inet | awk '{print $2}'`
	 NetMask6=`ifconfig en5 | grep inet | awk '{print $4}'`
	 BrisqueDomain6=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp6 $NetMask6 | awk '{print $1}'`
	 LastAdrsInDomain6=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp6 $NetMask6 | awk '{print $2}'`
	 ModemDomain6=`$SCI_SCRIPTS/RemoteTools/FindSubnet $ModemIp $NetMask6 | awk '{print $1}'`
fi
#
if [ "$Interface7" != "" ];
then
	 LocalBrisqueIp7=`ifconfig en6 | grep inet | awk '{print $2}'`
	 NetMask7=`ifconfig en6 | grep inet | awk '{print $4}'`
	 BrisqueDomain7=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp4 $NetMask7 | awk '{print $1}'`
	 LastAdrsInDomain7=`$SCI_SCRIPTS/RemoteTools/FindSubnet $LocalBrisqueIp7 $NetMask7 | awk '{print $2}'`
	 ModemDomain7=`$SCI_SCRIPTS/RemoteTools/FindSubnet $ModemIp $NetMask7 | awk '{print $1}'`
fi
#echo $BrisqueDomain0
#echo $BrisqueDomain1
if [ "$ModemDomain0" = "" ]; then
  	ModemDomain0="none"
fi
if [ "$ModemDomain1" = "" ]; then
  	ModemDomain1="none"
fi
if [ "$ModemDomain2" = "" ]; then
  	ModemDomain2="none"
fi
if [ "$ModemDomain3" = "" ]; then
  	ModemDomain3="none"
fi
if [ "$ModemDomain4" = "" ]; then
  	ModemDomain4="none"
fi
if [ "$ModemDomain5" = "" ]; then
  	ModemDomain5="none"
fi
if [ "$ModemDomain6" = "" ]; then
  	ModemDomain6="none"
fi
if [ "$ModemDomain7" = "" ]; then
  	ModemDomain7="none"
fi
if [ "$ModemDomain0" != "$BrisqueDomain0" ] && [ "$ModemDomain1" != "$BrisqueDomain1" ] && [ "$ModemDomain2" != "$BrisqueDomain2" ] && [ "$ModemDomain3" != "$BrisqueDomain3" ] && [ "$ModemDomain4" != "$BrisqueDomain4" ] && [ "$ModemDomain5" != "$BrisqueDomain5" ] && [ "$ModemDomain6" != "$BrisqueDomain6" ] && [ "$ModemDomain7" != "$BrisqueDomain7" ] ;
then
     echo "      The Modem IP must be assigned in the same subnets as of the one \n      of the interfaces:"
     if [ "$BrisqueDomain0" <> "" ]; then
        echo "\n              $LocalBrisqueIp0  { Domain : $BrisqueDomain0 - $LastAdrsInDomain0 }"
     fi
     if [ "$BrisqueDomain1" <> "" ]; then
        echo "\n              $LocalBrisqueIp1  { Domain : $BrisqueDomain1 - $LastAdrsInDomain1 }"
     fi
     if [ "$BrisqueDomain2" <> "" ]; then
        echo "\n              $LocalBrisqueIp2  { Domain : $BrisqueDomain2 - $LastAdrsInDomain2 }"
     fi
     if [ "$BrisqueDomain3" <> "" ]; then
        echo "\n              $LocalBrisqueIp3  { Domain : $BrisqueDomain3 - $LastAdrsInDomain3 }"
     fi
     if [ "$BrisqueDomain4" <> "" ]; then
        echo "\n              $LocalBrisqueIp4  { Domain : $BrisqueDomain4 - $LastAdrsInDomain4 }"
     fi
     if [ "$BrisqueDomain5" <> "" ]; then
        echo "\n              $LocalBrisqueIp5  { Domain : $BrisqueDomain5 - $LastAdrsInDomain5 }"
     fi
     if [ "$BrisqueDomain6" <> "" ]; then
        echo "\n              $LocalBrisqueIp6  { Domain : $BrisqueDomain6 - $LastAdrsInDomain6 }"
     fi
     if [ "$BrisqueDomain7" <> "" ]; then
        echo "\n              $LocalBrisqueIp7  { Domain : $BrisqueDomain7 - $LastAdrsInDomain7 }"
     fi
     echo "\n\n      The script will be terminated."
     exit 1
fi
# Save IP address for cold-start purpose -- Ronit 11/00
if [ -f $SCI_SCRIPTS/RemoteTools/scippp ]; then 
   rm $SCI_SCRIPTS/RemoteTools/scippp
fi
echo "$1" >> $SCI_SCRIPTS/RemoteTools/scippp
if [ -f /etc/ppp/lcp_config ]; then 
   /etc/ppp/mkppp -stop 'both'  
   rm /etc/ppp/lcp_config 
   rm /etc/ppp/if_conf  
fi 
sleep 1 
cmd=`arp -a | grep scippp`
if [ "$cmd" = "" ] ; then  
#Do nothing
echo ""
else
#delete scippp from arp table, before changing its IP address
arp -d scippp
fi
#cmd=`grep $2 /etc/hosts` 
cmd=`grep scippp /etc/hosts` 
#echo $cmd ; echo "\n"  
if [ "$cmd" = "" ] ; then  
#echo "not Found \n"   
echo ""$1"   scippp" >> /etc/hosts  
else
$SCI_SCRIPTS/RemoteTools/RemoveScippp
sleep 1
echo ""$1"   scippp" >> /etc/hosts  
fi  
###########
# removed by ido - 17-NOV-1999
#
# TTY=`tty | grep tty0`
# cmd=`lsdev -Ct tty | grep tty0 | grep Available`
# if [ "$cmd" != "" ] && [ "$TTY" = "" ] ; then  
#    pdisable tty0
#    sleep 1
#    chdev  -l 'tty0' -a speed='38400'
#    penable tty0
# fi
# 
# 
# TTY=`tty | grep tty1`
# cmd=`lsdev -Ct tty | grep tty1 | grep Available`
# if [ "$cmd" != "" ] && [ "$TTY" = "" ] ; then  
#   pdisable tty1
#   sleep 1
#   chdev  -l 'tty1' -a speed='38400'
#   penable tty1
# fi
############
#Enable IP forwarding  
cmd=`grep ipforwarding /etc/rc.net`  
if [ "$cmd" = "" ] ; then  
echo "no -o ipforwarding=1\n" >> /etc/rc.net  
fi  
no -o ipforwarding=1  
Arp_en0() { 
   #Add scippp entry in the ARP table  
   if  [ $osmajor -ge 431 ] ; 
   then
	address=`netstat -I en0 | grep link | awk '{print $4}'`  
   else
	address=`netstat -i | grep en0 | grep Link | awk -F ">" '{print $2}' | awk '{print $1}'` 
   fi
   address=`echo $address | awk '{gsub("\\\.",":",$0);print $1}'` 
   cmd="arp -s ether scippp "$address" pub" 
   if [ "$address" = "" ] ; then  
      continue  
   else   
      echo $cmd  
      test=`grep $address /etc/rc.net`  
      if [ "$test" != "" ];
      then  
         $SCI_SCRIPTS/RemoteTools/AddToScript r /etc/rc.net /tmp/rc.net.tmp  "$test" ""
         cp /tmp/rc.net.tmp /etc/rc.net
         echo $cmd >> /etc/rc.net
      else
         echo $cmd >> /etc/rc.net
      fi  
      $cmd  
   fi   
}  
Arp_en1() { 
   #Add scippp entry in the ARP table  
   if  [ $osmajor -ge 431 ] ; 
   then
	address=`netstat -I en1 | grep link | awk '{print $4}'`  
   else
	address=`netstat -i | grep en1 | grep Link | awk -F ">" '{print $2}' | awk '{print $1}'`  
   fi
   address=`echo $address | awk '{gsub("\\\.",":",$0);print $1}'`  
   cmd="arp -s ether scippp "$address" pub"  
   if [ "$address" = "" ] ; then  
      continue  
   else   
      echo $cmd  
      test=`grep $address /etc/rc.net`  
      if [ "$test" != "" ] ; then  
         $SCI_SCRIPTS/RemoteTools/AddToScript r /etc/rc.net /tmp/rc.net.tmp  "$test" ""
         cp /tmp/rc.net.tmp /etc/rc.net
         echo $cmd >> /etc/rc.net  
      else
         echo $cmd >> /etc/rc.net  
      fi  
     $cmd  
   fi   
} 
Arp_fi0() { 
   #Add scippp entry in the ARP table  
   if  [ $osmajor -ge 431 ] ; 
   then
	address=`netstat -I fi0 | grep link | awk '{print $4}'`  
   else
	address=`netstat -i | grep fi0 | grep Link | awk -F ">" '{print $2}' | awk '{print $1}'`  
   fi
   address=`echo $address | awk '{gsub("\\\.",":",$0);print $1}'`  
   cmd="arp -s ether scippp "$address" pub"  
   if [ "$address" = "" ] ; then  
      continue  
   else   
      echo $cmd  
      test=`grep $address /etc/rc.net`  
      if [ "$test" != "" ] ; then  
         $SCI_SCRIPTS/RemoteTools/AddToScript r /etc/rc.net /tmp/rc.net.tmp  "$test" ""
         cp /tmp/rc.net.tmp /etc/rc.net
         echo $cmd >> /etc/rc.net  
      else
         echo $cmd >> /etc/rc.net  
      fi  
     $cmd  
   fi   
} 
Arp_en2() { 
   #Add scippp entry in the ARP table  
   if  [ $osmajor -ge 431 ] ; 
   then
	address=`netstat -I en2 | grep link | awk '{print $4}'`  
   else
	address=`netstat -i | grep en2 | grep Link | awk -F ">" '{print $2}' | awk '{print $1}'`  
   fi
   address=`echo $address | awk '{gsub("\\\.",":",$0);print $1}'`  
   cmd="arp -s ether scippp "$address" pub"  
   if [ "$address" = "" ] ; then  
      continue  
   else   
      echo $cmd  
      test=`grep $address /etc/rc.net`  
      if [ "$test" != "" ] ; then  
         $SCI_SCRIPTS/RemoteTools/AddToScript r /etc/rc.net /tmp/rc.net.tmp  "$test" ""
         cp /tmp/rc.net.tmp /etc/rc.net
         echo $cmd >> /etc/rc.net  
      else
         echo $cmd >> /etc/rc.net  
      fi  
     $cmd  
   fi   
} 
Arp_en3() { 
   #Add scippp entry in the ARP table  
   if  [ $osmajor -ge 431 ] ; 
   then
	address=`netstat -I en3 | grep link | awk '{print $4}'`  
   else
	address=`netstat -i | grep en3 | grep Link | awk -F ">" '{print $2}' | awk '{print $1}'`  
   fi
   address=`echo $address | awk '{gsub("\\\.",":",$0);print $1}'`  
   cmd="arp -s ether scippp "$address" pub"  
   if [ "$address" = "" ] ; then  
      continue  
   else   
      echo $cmd  
      test=`grep $address /etc/rc.net`  
      if [ "$test" != "" ] ; then  
         $SCI_SCRIPTS/RemoteTools/AddToScript r /etc/rc.net /tmp/rc.net.tmp  "$test" ""
         cp /tmp/rc.net.tmp /etc/rc.net
         echo $cmd >> /etc/rc.net  
      else
         echo $cmd >> /etc/rc.net  
      fi  
     $cmd  
   fi   
} 
Arp_en4() { 
   #Add scippp entry in the ARP table  
   if  [ $osmajor -ge 431 ] ; 
   then
	address=`netstat -I en4 | grep link | awk '{print $4}'`  
   else
	address=`netstat -i | grep en4 | grep Link | awk -F ">" '{print $2}' | awk '{print $1}'`  
   fi
   address=`echo $address | awk '{gsub("\\\.",":",$0);print $1}'`  
   cmd="arp -s ether scippp "$address" pub"  
   if [ "$address" = "" ] ; then  
      continue  
   else   
      echo $cmd  
      test=`grep $address /etc/rc.net`  
      if [ "$test" != "" ] ; then  
         $SCI_SCRIPTS/RemoteTools/AddToScript r /etc/rc.net /tmp/rc.net.tmp  "$test" ""
         cp /tmp/rc.net.tmp /etc/rc.net
         echo $cmd >> /etc/rc.net  
      else
         echo $cmd >> /etc/rc.net  
      fi  
     $cmd  
   fi   
} 
Arp_en5() { 
   #Add scippp entry in the ARP table  
   if  [ $osmajor -ge 431 ] ; 
   then
	address=`netstat -I en5 | grep link | awk '{print $4}'`  
   else
	address=`netstat -i | grep en5 | grep Link | awk -F ">" '{print $2}' | awk '{print $1}'`  
   fi
   address=`echo $address | awk '{gsub("\\\.",":",$0);print $1}'`  
   cmd="arp -s ether scippp "$address" pub"  
   if [ "$address" = "" ] ; then  
      continue  
   else   
      echo $cmd  
      test=`grep $address /etc/rc.net`  
      if [ "$test" != "" ] ; then  
         $SCI_SCRIPTS/RemoteTools/AddToScript r /etc/rc.net /tmp/rc.net.tmp  "$test" ""
         cp /tmp/rc.net.tmp /etc/rc.net
         echo $cmd >> /etc/rc.net  
      else
         echo $cmd >> /etc/rc.net  
      fi  
     $cmd  
   fi   
} 
Arp_en6() { 
   #Add scippp entry in the ARP table  
   if  [ $osmajor -ge 431 ] ; 
   then
	address=`netstat -I en6 | grep link | awk '{print $4}'`  
   else
	address=`netstat -i | grep en6 | grep Link | awk -F ">" '{print $2}' | awk '{print $1}'`  
   fi
   address=`echo $address | awk '{gsub("\\\.",":",$0);print $1}'`  
   cmd="arp -s ether scippp "$address" pub"  
   if [ "$address" = "" ] ; then  
      continue  
   else   
      echo $cmd  
      test=`grep $address /etc/rc.net`  
      if [ "$test" != "" ] ; then  
         $SCI_SCRIPTS/RemoteTools/AddToScript r /etc/rc.net /tmp/rc.net.tmp  "$test" ""
         cp /tmp/rc.net.tmp /etc/rc.net
         echo $cmd >> /etc/rc.net  
      else
         echo $cmd >> /etc/rc.net  
      fi  
     $cmd  
   fi   
} 
#lotem_address=`grep -i lotem /etc/hosts` 
#echo $lotem_address 
function add_link   
{  
/etc/ppp/mkppp $*   
}  
add_link -sn 'AIXPPP' -sl '1' -cl '0' -dl '0' -ip '1' -att '1'  
# Add ip configuration  
function chgip_configuration   
{  
/etc/ppp/mkppp -add -na 1 $*   
RC=$?   
if [ $RC != 0 ];   
then   
   /etc/ppp/mkppp -add -na 1   
else   
   if [ -f /tmp/__ppp_file ]; then  
    rm /tmp/__ppp_file  
   fi  
fi   
}  
if [ "$ModemDomain0" = "$BrisqueDomain0" ]; 
then
     Arp_en0 
     sleep 1 
     #chgip_configuration -lip $LocalBrisqueIp0 -rip $1 -netmask '255.255.240.0'   
     chgip_configuration -lip $LocalBrisqueIp0 -rip $1
 #  Start PPP service now, and after boot  
     /etc/ppp/mkppp -start 'both'  
elif [ "$ModemDomain1" = "$BrisqueDomain1" ]; 
then
     Arp_en1 
     sleep 1 
     #chgip_configuration -lip $LocalBrisqueIp1 -rip $1 -netmask '255.255.240.0'   
     chgip_configuration -lip $LocalBrisqueIp1 -rip $1
 #  Start PPP service now, and after boot  
     /etc/ppp/mkppp -start 'both'  
elif [ "$ModemDomain2" = "$BrisqueDomain2" ]; 
then
     Arp_fi0 
     sleep 1 
     #chgip_configuration -lip $LocalBrisqueIp2 -rip $1 -netmask '255.255.240.0'   
     chgip_configuration -lip $LocalBrisqueIp2 -rip $1
 #  Start PPP service now, and after boot  
     /etc/ppp/mkppp -start 'both'  
elif [ "$ModemDomain3" = "$BrisqueDomain3" ]; 
then
     Arp_en2 
     sleep 1 
     #chgip_configuration -lip $LocalBrisqueIp3 -rip $1 -netmask '255.255.240.0'   
     chgip_configuration -lip $LocalBrisqueIp3 -rip $1
 #  Start PPP service now, and after boot  
     /etc/ppp/mkppp -start 'both'  
elif [ "$ModemDomain4" = "$BrisqueDomain4" ]; 
then
     Arp_en3 
     sleep 1 
     #chgip_configuration -lip $LocalBrisqueIp4 -rip $1 -netmask '255.255.240.0'   
     chgip_configuration -lip $LocalBrisqueIp4 -rip $1
 #  Start PPP service now, and after boot  
     /etc/ppp/mkppp -start 'both'  
elif [ "$ModemDomain5" = "$BrisqueDomain5" ]; 
then
     Arp_en4 
     sleep 1 
     #chgip_configuration -lip $LocalBrisqueIp5 -rip $1 -netmask '255.255.240.0'   
     chgip_configuration -lip $LocalBrisqueIp5 -rip $1
 #  Start PPP service now, and after boot  
     /etc/ppp/mkppp -start 'both'  
elif [ "$ModemDomain6" = "$BrisqueDomain6" ]; 
then
     Arp_en5 
     sleep 1 
     #chgip_configuration -lip $LocalBrisqueIp6 -rip $1 -netmask '255.255.240.0'   
     chgip_configuration -lip $LocalBrisqueIp6 -rip $1
 #  Start PPP service now, and after boot  
     /etc/ppp/mkppp -start 'both'  
elif [ "$ModemDomain7" = "$BrisqueDomain7" ]; 
then
     Arp_en6 
     sleep 1 
     #chgip_configuration -lip $LocalBrisqueIp7 -rip $1 -netmask '255.255.240.0'   
     chgip_configuration -lip $LocalBrisqueIp7 -rip $1
 #  Start PPP service now, and after boot  
     /etc/ppp/mkppp -start 'both'  
fi
#Add ppp user from group uucp 
x() {  
LIST=  
SET_A=  
for i in "$@"  
do  
      if [ "$i" = "admin=true" ]  
    then  
          SET_A="-a"  
            continue  
      fi  
    LIST="$LIST \"$i\""  
done  
eval mkuser $SET_A $LIST  
}  
cmd=`lsuser ppp | grep group`  
if [ "$cmd" = "" ] ; 
then  
  x pgrp='uucp' ppp
  /usr/bin/passwd ppp
  cp /etc/ppp/login.profile /home/ppp/.profile 
fi
# arieh: 26-Dec-2002
# ido: 21-May-2002
if [ -d /home/ppp ];
then 
   echo "/home/ppp found" 
else
   mkdir /home/ppp
   cp /etc/ppp/login.profile /home/ppp/.profile 
   chown ppp /home/ppp/.profile
fi
# end 21-May-2002
# Removed by Ronit, 23.01.2001 
#awk -f $SCI_SCRIPTS/RemoteTools/ChStr.awk var1=nxqC9t9BuJ2gA /etc/security/passwd  > /tmp/passwd.tmp
#$SCI_SCRIPTS/RemoteTools/AddToScript r /tmp/passwd.tmp /etc/security/passwd.tmp  '	flags = ADMCHG' '	flags = '
#cp  /etc/security/passwd.tmp /etc/security/passwd
#Add rcdesci user from group scitex
rx() {  
LIST=  
SET_A=  
for i in "$@"  
do  
      if [ "$i" = "admin=true" ]  
    then  
          SET_A="-a"  
            continue  
      fi  
    LIST="$LIST \"$i\""  
done  
eval mkuser $SET_A $LIST  
}  
#if test ! -x /home/rcdesci 
cmd=`lsuser rcdesci | grep group`  
if [ "$cmd" = "" ] ; then  
   rx pgrp='scitex' rcdesci 
   /usr/bin/passwd  rcdesci 
   # Removed by Ronit, 23.01.2001 
   #$SCI_SCRIPTS/RemoteTools/AddToScript r /etc/security/passwd /etc/security/passwd.tmp  '	flags = ADMCHG' '	flags = '
   #cp  /etc/security/passwd.tmp /etc/security/passwd
fi
# Added by Ronit, 23.01.2001
$SCI_SCRIPTS/RemoteTools/AddToScript r /etc/security/passwd /etc/security/passwd.tmp  '	flags = ADMCHG' '	flags = '
cp  /etc/security/passwd.tmp /etc/security/passwd
