File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Download the [subnet](https://github.com/eetami/subnet/releases/latest) shell
1313script to your ` ~/.local/bin ` directory.
1414
1515``` bash
16- SUBNET_VERSION=' v0.4.3 '
16+ SUBNET_VERSION=' v0.4.4 '
1717wget -O ~ /.local/bin/subnet " https://github.com/eetami/subnet/releases/download/${SUBNET_VERSION} /subnet"
1818chmod +x ~ /.local/bin/subnet
1919subnet -h
Original file line number Diff line number Diff line change @@ -239,10 +239,20 @@ if (( ip_version == 4 )); then
239239 let -i ip_start=network_addr_int ip_end=broadcast_addr_int ||
240240 let -i ip_start=network_addr_int+1 ip_end=broadcast_addr_int-1
241241 print_ipv4 " $ip_start " " $m " " $c "
242- ! $q && ! $u && printf " $NETWORK_ADDR_TOKEN "
242+ ! $q && {
243+ (( ip_start == ip_int )) && printf " $CURSOR_TOKEN " ;
244+ ! $u && {
245+ printf " $NETWORK_ADDR_TOKEN " ;
246+ };
247+ }
243248 printf ' %b' " $d "
244249 print_ipv4 " $ip_end " " $m " " $c "
245- ! $q && ! $u && printf " $BROADCAST_ADDR_TOKEN "
250+ ! $q && {
251+ (( ip_end == ip_int )) && printf " $CURSOR_TOKEN " ;
252+ ! $u && {
253+ printf " $BROADCAST_ADDR_TOKEN " ;
254+ };
255+ }
246256 echo
247257 exit
248258 fi
@@ -289,8 +299,10 @@ elif (( ip_version == 6 )); then
289299
290300 if (( ip_prefix < 122 )) ; then
291301 print_ipv6 " ${network_addr_ints[@]} " " $m " " $c "
302+ ! $q && (( ip_ints[0 ] == network_addr_ints[0 ] && ip_ints[1 ] == network_addr_ints[1 ] )) && printf " $CURSOR_TOKEN "
292303 printf ' %b' " $d "
293304 print_ipv6 " ${broadcast_addr_ints[@]} " " $m " " $c "
305+ ! $q && (( ip_ints[0 ] == broadcast_addr_ints[0 ] && ip_ints[1 ] == broadcast_addr_ints[1 ] )) && printf " $CURSOR_TOKEN "
294306 echo
295307 exit
296308 fi
You can’t perform that action at this time.
0 commit comments