summaryrefslogtreecommitdiff
path: root/src/completion/list_dumpable_interfaces.py
blob: f9748352ffbd0793a0cee678e82766f855737b96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python3

# Extract the list of interfaces available for traffic dumps from tcpdump -D

import re

from vyos.utils.process import cmd

if __name__ == '__main__':
    out = cmd('tcpdump -D').split('\n')
    intfs = " ".join(map(lambda s: re.search(r'\d+\.(\S+)\s', s).group(1), out))
    print(intfs)