mirror of https://github.com/dirtbags/moth.git
last-minute fixes for ipv4
This commit is contained in:
parent
bfb6449dbf
commit
cc6a937dd6
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue