CVS: theedge/var/lib/lunar/functions connect.lunar,NONE,1.1

sofar at lunar-linux.org sofar at lunar-linux.org
Sun Jul 20 15:35:27 GMT 2003


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory dbguin.lunar-linux.org:/tmp/cvs-serv3692/var/lib/lunar/functions

Added Files:
	connect.lunar 
Log Message:
since these 2 are a royal pain in the ass I decided to kick them into their own forget-me-file.


--- NEW FILE: connect.lunar ---
#!/bin/sh
############################################################
#                                                          #
# download.lunar - get sources from the net                #
#                                                          #
############################################################
# leach is part of the sorcery spell management utility    #
# Copyright 2001 by Kyle Sallee                            #
############################################################
#                                                          #
# this WAS the leach script of a source based Linux distro,#
# calls Sorcerer GNU/Linux, or SGL. SGL is no longer       #
# available with GPL license. Since this script was taken  #
# before licensing scheme change, no legal problems I      #
# guess.                                                   #
#                                                          #
# the code is re-written for Lunar. The previous Copyright #
# notices are kept; just in case some code is left :=)     #
# Kagan Kongar <kongar at tsrsb.org.tr>, 20020519             #
#                                                          #
# This secondly was lget mostly, and has been moved into   #
# a separate lunar functions file handling all the generic #
# downloading functionality for lunar                      #
#                                                          #
############################################################
#                                                          #
# Parts Copyrighted  Jason Johnston  2002 under GPLv2      #
#                                                          #
# Parts Copyrighted  Kagan Kongar  2002 under GPLv2        #
#                                                          #
# Parts Copyrighted  Auke Kok  2002 under GPLv2            #
#                                                          #
############################################################


connect()  {

  if  !  ifconfig  |  grep  -q  "^eth"   &&
      !  ifconfig  |  grep  -q  "^wlan"  &&
      !  ifconfig  |  grep  -q  "^ppp"   &&
      !  ifconfig  |  grep  -q  "^tun";  then
    pon

    # Timeout in deciseconds to wait for Interface to come up.
    TIMEOUT=30

    until  ifconfig  |  grep  -q  eth   ||
           ifconfig  |  grep  -q  ppp   ||
           [  $TIMEOUT == 0  ]
    do
      sleep  10
      (( TIMEOUT-- ))
    done
    disconnect

  fi

}


disconnect()  {
  if    ps  -C disconnect  >  /dev/null
  then  return
  fi

  rm  -f           /tmp/disconnect
  cat  <<  EOF  >  /tmp/disconnect
#!/bin/sh

while  ps  -A  |  grep  -q  "lget";  do  sleep  120;  done
poff
rm  -f  /tmp/disconnect
EOF

chmod  a+x  /tmp/disconnect
            /tmp/disconnect  &

}






More information about the Lunar-commits mailing list