openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
4.01k stars 3.48k forks source link

mwan3: `grep: warning: stray \ before :` when using gnu grep #25198

Open vincejv opened 1 week ago

vincejv commented 1 week ago

Maintainer: @feckert Environment: x86-64 OpenWrt SNAPSHOT, r27897-b27075e12b mwan 2.11.16-r4 grep 3.11-r1 Description: Something is wrong with mwan3 script when using with GNU grep instead of busybox

Repro:

  1. install gnu grep by opkg install grep
  2. run service mwan3 restart
  3. Boom! Warning is printed when service is restarted
grep: warning: stray \ before :
grep: warning: stray \ before :

Work around solution: go back to busybox grep

Chris1189 commented 1 week ago

Hi, I looked in your issue. Could you please test in your /etc/init.d/mwan3 if changing line 80: for rule in $($IP rule list | grep -E '^[1-3][0-9]{3}\:' | cut -d ':' -f 1); do to for rule in $($IP rule list | grep -E '^[1-3][0-9]{3}:' | cut -d ':' -f 1); do fixes the problem?