Skip to content

Commit

Permalink
2nd attempt to fix IPADDR autofill
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyaz committed Feb 19, 2020
1 parent 97e7cc5 commit 1ff5c1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions YazFi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -518,14 +518,14 @@ Conf_FixBlanks(){
if [ -z "$(eval echo '$'"$IFACETMPBLANK""_IPADDR")" ]; then
IPADDRTMPBLANK="192.168.0"

COUNTER=1
COUNTER=0
until [ "$(grep -o "$IPADDRTMPBLANK" $YAZFI_CONF | wc -l)" -eq 0 ] && [ "$(ifconfig -a | grep -o "$IPADDRTMPBLANK" | wc -l )" -eq 0 ]; do
IPADDRTMPBLANK="$(echo "$LAN" | cut -f1-2 -d".").$(($(echo "$LAN" | cut -f3 -d".")+COUNTER))"
IPADDRTMPBLANK="192.168.""$COUNTER"
COUNTER=$((COUNTER + 1))
done

sed -i -e "s/""$IFACETMPBLANK""_IPADDR=/""$IFACETMPBLANK""_IPADDR=""$IPADDRTMPBLANK"".0/" "$YAZFI_CONF"
Print_Output "false" "$IFACETMPBLANK""_IPADDR is blank, setting to next available subnet above primary LAN subnet" "$WARN"
Print_Output "false" "$IFACETMPBLANK""_IPADDR is blank, setting to next available subnet" "$WARN"
fi

if [ -z "$(eval echo '$'"$IFACETMPBLANK""_DHCPSTART")" ]; then
Expand Down

0 comments on commit 1ff5c1a

Please sign in to comment.