Skip to content

Instantly share code, notes, and snippets.

@iMilnb
Created January 12, 2014 19:38
Show Gist options
  • Save iMilnb/8389380 to your computer and use it in GitHub Desktop.
Save iMilnb/8389380 to your computer and use it in GitHub Desktop.
Oneliner to generate dvblast configuration files from `channels.conf'
i=1 && for f in `cut -f2 -d: channels.conf |sort -u`; do cf=etc/dvblast$((i++)).conf; echo "; dvblast -f $f -c $cf" > $cf; awk -F: -v f=$f -v b=$i 'BEGIN {p = 0} $0 ~ f {printf "; %s\n224.0.0.%s:123%d 1 %s %s,%s\n",$1,b,++p,$13,$11,$12}' channels.conf >> $cf ;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment