Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

80 lines (64 sloc) 2.791 kb
#!/bin/bash
############################################################
# #
# 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@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() {
local TIMEOUT
debug_msg "connect ($@)"
if ! ifconfig | grep -q "^eth[0-9]\|^wlan[0-9]\|^ppp[0-9]\|^ath[0-9]\|^tun[0-9]\|^ra[0-9]\|^usb[0-9]"
then
pon
# Timeout in deciseconds to wait for Interface to come up.
TIMEOUT=30
until ifconfig | grep -q "^eth[0-9]\|^wlan[0-9]\|^ppp[0-9]\|^ath[0-9]\|^tun[0-9]\|^ra[0-9]\|^usb[0-9]" || [ $TIMEOUT == 0 ]
do
sleep 10
(( TIMEOUT-- ))
done
disconnect
fi
}
disconnect() {
debug_msg "disconnect ($@)"
if ps -C disconnect > /dev/null
then return
fi
rm -f $TMPDIR/disconnect
cat << EOF > $TMPDIR/disconnect
#!/bin/sh
while ps -A | grep -q "lget"; do sleep 120; done
poff
rm -f $TMPDIR/disconnect
EOF
chmod a+x $TMPDIR/disconnect
$TMPDIR/disconnect &
}
Jump to Line
Something went wrong with that request. Please try again.