View | Details | Raw Unified
Collapse All | Expand All

(-) ifconfig.sh (-15 / +7 lines)
 Lines 362-382    Link Here 
			[[ ${x} != *"-A inet6"* ]] && x="-A inet6 ${x}"
			[[ ${x} != *"-A inet6"* ]] && x="-A inet6 ${x}"
			x="${x// -net / }"
			x="${x// -net / }"
		else
		else
			# Work out if we're a host or a net if not told
			case ${x} in
			if [[ " ${x} " != *" -net "* && " ${x} " != *" -host "* ]] ; then
				-net" "*|-host" "*);;
				y="${x% *}"
				*" "netmask" "*) x="-net ${x}";;
				y="${y##* }"
				*.*.*.*/32*)     x="-host ${x}";;
				if [[ ${x} == *" netmask "* ]] ; then
				*.*.*.*/*|0.0.0.0" "*|default" "*) x="-net ${x}";;
					x="-net ${x}"
				*)               x="-host ${x}";;
				elif [[ ${y} == *.*.*.*/32 ]] ; then
			esac
					x="-host ${x}"
				elif [[ ${y} == *.*.*.*/* || ${y} == "default" || ${y} == "0.0.0.0" ]] ; then
					x="-net ${x}"
				else
					# Given the lack of a netmask, we assume a host
					x="-host ${x}"
				fi
			fi
		fi
		fi
		# Add a metric if we don't have one
		# Add a metric if we don't have one