Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
508121866c | ||
|
|
7793e4bc19 |
7
Makefile
7
Makefile
@@ -8,13 +8,14 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
DEPENDS = dhclient,iproute2
|
||||
DEPENDS = dash,dhclient,iproute2
|
||||
ARCH = none
|
||||
URL =
|
||||
URL = http://snaplinux.org/
|
||||
REPO = core
|
||||
BRIEF = Scripts for starting and stopping network interfaces
|
||||
DESC = Scripts which use the iproute2 tools for automatically starting and \
|
||||
stopping network devices during startup.
|
||||
SNAPVER = 0
|
||||
SNAPVER = 1
|
||||
|
||||
ARCHIVE :=
|
||||
SRCDIR := $(PWD)/SRC/iftools
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
@@ -7,8 +7,8 @@ case $1 in
|
||||
exit 0
|
||||
;;
|
||||
postinst)
|
||||
if [ ! -f ${TARGET}/etc/network.conf ]; then
|
||||
cp ${TARGET}/usr/share/iftools/network.conf ${TARGET}/etc/network.conf
|
||||
if [ ! -f /etc/network.conf ]; then
|
||||
cp /usr/share/iftools/network.conf /etc/network.conf
|
||||
fi
|
||||
;;
|
||||
prerm)
|
||||
|
||||
@@ -2,7 +2,8 @@ dirs:
|
||||
install -d -v -m 755 $(DESTDIR)/etc/init.d
|
||||
install -d -v -m 755 $(DESTDIR)/etc/network.d
|
||||
install -d -v -m 755 $(DESTDIR)/usr/share/iftools
|
||||
install -d -v -m 755 $(DESTDIR)/usr/share/man/man{5,8}
|
||||
install -d -v -m 755 $(DESTDIR)/usr/share/man/man5
|
||||
install -d -v -m 755 $(DESTDIR)/usr/share/man/man8
|
||||
install -d -v -m 755 $(DESTDIR)/sbin
|
||||
|
||||
files:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
VERSION=1.1
|
||||
VERSION=1.2
|
||||
CONFDIR=/etc
|
||||
CONFIGFILE=$CONFDIR/network.conf
|
||||
NL='
|
||||
@@ -19,7 +19,9 @@ auto () {
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done <<< "$1"
|
||||
done << EOF
|
||||
$1
|
||||
EOF
|
||||
|
||||
echo "$autoifaces"
|
||||
}
|
||||
@@ -84,7 +86,9 @@ getinet () {
|
||||
address=${address%% *}
|
||||
;;
|
||||
esac
|
||||
done <<< "$(ip addr show $iface)"
|
||||
done << EOF
|
||||
$(ip addr show $iface)
|
||||
EOF
|
||||
|
||||
echo $address
|
||||
}
|
||||
@@ -218,7 +222,9 @@ up () {
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done <<< "$2"
|
||||
done << EOF
|
||||
$2
|
||||
EOF
|
||||
|
||||
if [ -z "$exists" ]; then
|
||||
echo "$iface not defined"
|
||||
@@ -306,10 +312,8 @@ up () {
|
||||
|
||||
if [ -n "$noact" ]; then
|
||||
echo "ip link set dev $iface up"
|
||||
echo "ip addr add 127.0.0.1/8 dev $iface"
|
||||
else
|
||||
ip link set dev $iface up
|
||||
ip addr add 127.0.0.1/8 dev $iface
|
||||
fi
|
||||
elif [ -n "$static" ]; then
|
||||
case "$iface" in
|
||||
@@ -353,7 +357,7 @@ up () {
|
||||
fi
|
||||
|
||||
if [ -n "$gateway" ]; then
|
||||
[ -z "$verbose" ] && echo "Setting default route via $gateway"
|
||||
[ -n "$verbose" ] && echo "Setting default route via $gateway"
|
||||
|
||||
if [ -n "$noact" ]; then
|
||||
echo "ip route add default via $gateway"
|
||||
@@ -381,7 +385,7 @@ up () {
|
||||
if [ -n "$noact" ]; then
|
||||
echo "ip route add $route dev $iface src $address"
|
||||
else
|
||||
ip route add $route dev $iface src $address
|
||||
ip route add $route dev "$iface" src "$address"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user