Ticket #10343: openwrt_muninlite_ifname.patch

File openwrt_muninlite_ifname.patch, 1.3 KB (added by lecoyote@…, 4 years ago)

muninlite: allow hyphened if names, add pptp support

  • munin-node

    old new  
    531531for PLUG in $PLUGINS 
    532532do  
    533533  if [ "$PLUG" = "if_" ]; then   
    534     for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g 
    535 s/\-/_/g'); 
     534    for INTER in $(grep '^ *\(ppp\|pptp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); 
    536535    do 
    537       INTERRES=$(echo $INTER | sed 's/\./VLAN/') 
     536      INTERRES=$(echo $INTER | sed 's/\./VLAN/ 
     537s/\-/_/g') 
    538538      RES="$RES if_$INTERRES" 
    539539      eval "fetch_if_${INTERRES}() { fetch_if $INTER $@; };" 
    540540      eval "config_if_${INTERRES}() { config_if $INTER $@; };" 
    541541    done 
    542542  elif [ "$PLUG" = "if_err_" ]; then 
    543     for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g 
    544 s/\-/_/g'); 
     543    for INTER in $(grep '^ *\(ppp\|pptp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); 
    545544    do 
    546       INTERRES=$(echo $INTER | sed 's/\./VLAN/') 
     545      INTERRES=$(echo $INTER | sed 's/\./VLAN/ 
     546s/\-/_/g') 
    547547      RES="$RES if_err_$INTERRES" 
    548548      eval "fetch_if_err_${INTERRES}() { fetch_if_err $INTER $@; };" 
    549549      eval "config_if_err_${INTERRES}() { config_if_err $INTER $@; };"