last-minute fixes for ipv4

This commit is contained in:
Neale Pickett 2012-04-24 10:03:14 -06:00
parent eea456a15e
commit f432eee020
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ fatsize=$(sfdisk -l /dev/sdb | awk '/^Disk/ {print $3 - 2;}')
FATFS=${DRIVE}1 FATFS=${DRIVE}1
EXTFS=${DRIVE}2 EXTFS=${DRIVE}2
sfdisk $DRIVE <<EOF sfdisk $DRIVE <<EOF || true
,$fatsize,6,* ,$fatsize,6,*
,,L ,,L
EOF EOF

View File

@ -6,7 +6,7 @@ read n < ip.txt
if grep -q ipv4 /proc/cmdline; then if grep -q ipv4 /proc/cmdline; then
# IPv4 # IPv4
IP="10.0.0.$n/24" IP="10.0.0.$n/16"
else else
# IPv6 # IPv6
l=$(busybox dc 16 o $n p) l=$(busybox dc 16 o $n p)
@ -20,7 +20,7 @@ fi
if [ "$action" = "add" ]; then if [ "$action" = "add" ]; then
fail=fail fail=fail
for i in $(seq 5); do for i in $(seq 5); do
if ip addr | grep -Fq $IP; then if ip addr | grep -v tentative | grep -Fq $IP; then
fail= fail=
break break
fi fi