permit running in light-ns
This commit is contained in:
parent
7b85a0d388
commit
a832d0ad48
@ -101,4 +101,4 @@ def main():
|
||||
if len(sys.argv) != 2:
|
||||
print("Need name of client interface as argument")
|
||||
sys.exit(1)
|
||||
trio.run(amain, sys.argv[1:])
|
||||
trio.run(amain, sys.argv[1])
|
||||
|
@ -16,7 +16,12 @@ fi
|
||||
targetname="/var/lib/prometheus/node-exporter/capport-${instance}.prom"
|
||||
tmpname="${targetname}.$$"
|
||||
|
||||
if ./stats.sh "${ifname}" > "${tmpname}"; then
|
||||
if [ -f "/run/netns/${instance}" ];then
|
||||
_run_in_ns="/usr/sbin/ns-enter ${instance} -- "
|
||||
else
|
||||
_run_in_ns=""
|
||||
fi
|
||||
if ${_run_in_ns} ${base}/stats.sh "${ifname}" > "${tmpname}"; then
|
||||
mv "${tmpname}" "${targetname}"
|
||||
else
|
||||
rm "${tmpname}"
|
||||
|
Loading…
Reference in New Issue
Block a user