mirror of https://github.com/dirtbags/moth.git
last-minute fixes for ipv4
This commit is contained in:
parent
1502fb56c5
commit
00c5ad65c4
|
@ -14,7 +14,7 @@ fatsize=$(sfdisk -l /dev/sdb | awk '/^Disk/ {print $3 - 2;}')
|
|||
FATFS=${DRIVE}1
|
||||
EXTFS=${DRIVE}2
|
||||
|
||||
sfdisk $DRIVE <<EOF
|
||||
sfdisk $DRIVE <<EOF || true
|
||||
,$fatsize,6,*
|
||||
,,L
|
||||
EOF
|
||||
|
|
|
@ -6,7 +6,7 @@ read n < ip.txt
|
|||
|
||||
if grep -q ipv4 /proc/cmdline; then
|
||||
# IPv4
|
||||
IP="10.0.0.$n/24"
|
||||
IP="10.0.0.$n/16"
|
||||
else
|
||||
# IPv6
|
||||
l=$(busybox dc 16 o $n p)
|
||||
|
@ -20,7 +20,7 @@ fi
|
|||
if [ "$action" = "add" ]; then
|
||||
fail=fail
|
||||
for i in $(seq 5); do
|
||||
if ip addr | grep -Fq $IP; then
|
||||
if ip addr | grep -v tentative | grep -Fq $IP; then
|
||||
fail=
|
||||
break
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue