#!/bin/sh

# Appends "<action>:<priority>" to the interface alias, which lets the
# hook test see every invocation and its arguments.

set -eu

alias=$(ip -j link show dev "$IFS_IFNAME" | jq -r '.[0].ifalias // ""')
ip link set dev "$IFS_IFNAME" alias "${alias:+$alias,}$1:$IFS_ARG_PRIORITY"
