#!/bin/bash

%for interface in %%range(0, %%int(%%nombre_interfaces))
 %if %%getVar('debit_carte_eth' + %%str(%%interface) + '_autoneg') == 'oui'
/sbin/ethtool -s %%getVar('nom_zone_eth'+%%str(%%interface)) autoneg on
 %else
  %set %%speed = %%getVar('debit_carte_eth' + %%str(%%interface) + '_speed')
  %set %%duplex = %%getVar('debit_carte_eth' + %%str(%%interface) + '_duplex')
/sbin/ethtool -s %%getVar('nom_zone_eth'+%%str(%%interface)) speed %%speed duplex %%duplex autoneg off
 %end if
%end for
