dhclient would return 0 if invoked without an interface argument, so set this

to eth0. Oh, what a hack...but it works :)

svn path=/nixpkgs/trunk/; revision=5050
This commit is contained in:
Armijn Hemel 2006-03-17 16:33:59 +00:00
parent 35e30e7797
commit 67971a4349
2 changed files with 26 additions and 3 deletions

View File

@ -15,17 +15,22 @@ source @initscripts@/functions
RETVAL=0
prog="network"
INTERFACE=eth0
startService()
{
# just do networking
echo -n $"Starting $prog:"
@dhcp@/sbin/dhclient
echo -n "Starting $prog:"
@dhcp@/sbin/dhclient $INTERFACE
RETVAL=$?
echo "retval $RETVAL"
return $RETVAL
}
stopService()
{
echo -n $"Stopping $prog:"
echo "BLAAT"
}
reload()

View File

@ -13,6 +13,7 @@ NIXPKGS=@nixpkgs@
start_deps() {
for i in $deps; do
echo $i
name=`$i/control name`
if ! test -a "$RCDIR/$name"; then
@ -57,12 +58,28 @@ start() {
# if not, continue
# launch all hard dependencies
start_deps
RETVAL=$?
if test $RETVAL != 0; then
echo $prog failed
exit $RETVAL
fi
# launch all preferred dependencies
echo "softdeps" $softdeps
start_softdeps
# launch our own program
startService
# if successful, then register
RETVAL=$?
if test $RETVAL != 0; then
echo $prog failed
exit $RETVAL
fi
register
}
@ -74,6 +91,7 @@ stop() {
fi
# stop our own program
stopService
echo "unregistering"
unregister
}