You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
703 B

#!/bin/sh
#
# Format:
# vlan=<vlanname>:<phydevice>
#
parsevlan() {
local v=${1}:
set --
while [ -n "$v" ]; do
set -- "$@" "${v%%:*}"
v=${v#*:}
done
unset vlanname phydevice
case $# in
2)
vlanname=$1
phydevice=$2
;;
*) die "vlan= requires two parameters" ;;
esac
}
for vlan in $(getargs vlan=); do
unset vlanname
unset phydevice
if [ ! "$vlan" = "vlan" ]; then
parsevlan "$vlan"
fi
echo "phydevice=\"$phydevice\"" > /tmp/vlan.${phydevice}.phy
{
echo "vlanname=\"$vlanname\""
echo "phydevice=\"$phydevice\""
} > /tmp/vlan.${vlanname}.${phydevice}
done