Browse Source

Added support of "ip link set"

Dmitry Yu Okunev 7 years ago
parent
commit
3a59360b55
1 changed files with 10 additions and 2 deletions
  1. 10 2
      ipw

+ 10 - 2
ipw

@@ -144,8 +144,16 @@ ip_cmds() {
 	IP_CMDS_VARIABLE="${_IFACE//[.]/_}_IP"
 	IP_CMDS_VARIABLE="${IP_CMDS_VARIABLE}[@]"
 	for IP_CMD in "${!IP_CMDS_VARIABLE}"; do
-		[[ "$IP_CMD" != "" ]] &&
-			ip $IP_CMD dev "$_IFACE"
+		if [[ "$IP_CMD" != "" ]]; then
+			WORDS=($IP_CMD)
+			case "${WORDS[0]}" in
+				link)
+					ip $IP_CMD
+					;;
+				*)
+					ip $IP_CMD dev "$_IFACE"
+			esac
+		fi
 	done
 }