Skip to content

Commit

Permalink
Added: maskify util.
Browse files Browse the repository at this point in the history
It just converts IP without /prefix to IP/32 from stdin.
For example: stdin:

    10.0.0.2
    10.0.1.0/24

Stdout:

    10.0.0.2/32
    10.0.1.0/24
  • Loading branch information
strizhechenko committed Jun 7, 2017
1 parent ed106f2 commit a46a0c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utils/maskify
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -eu

ip_regex="([0-9]{1,3}\.){3}[0-9]{1,3}"

sed -E "s|^$ip_regex$|&/32|g"

0 comments on commit a46a0c4

Please sign in to comment.