Remove code to extract reports
dmarc-report-converter already does this
This commit is contained in:
parent
80963bad95
commit
82fd375392
|
@ -19,9 +19,7 @@
|
||||||
name = "reports";
|
name = "reports";
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
pkgs.dmarc-report-converter
|
pkgs.dmarc-report-converter
|
||||||
pkgs.gnutar
|
|
||||||
pkgs.python3
|
pkgs.python3
|
||||||
pkgs.unzip
|
|
||||||
];
|
];
|
||||||
text = (builtins.readFile ./reports.sh);
|
text = (builtins.readFile ./reports.sh);
|
||||||
};
|
};
|
||||||
|
|
26
reports.sh
26
reports.sh
|
@ -3,32 +3,6 @@ PORT=8080
|
||||||
mkdir -p "$WORKDIR"/xml
|
mkdir -p "$WORKDIR"/xml
|
||||||
mkdir -p "$WORKDIR"/html
|
mkdir -p "$WORKDIR"/html
|
||||||
|
|
||||||
extract-zips() {
|
|
||||||
echo "extracting zipped reports"
|
|
||||||
for i in "$WORKDIR"/xml/*.zip; do
|
|
||||||
unzip "$i" -d "$WORKDIR/xml" && rm -r "$i"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
extract-tars() {
|
|
||||||
echo "extracting tarred reports"
|
|
||||||
for i in "$WORKDIR"/xml/*.tar.gz; do
|
|
||||||
tar xzvf "$i" -C "$WORKDIR/xml" && rm -r "$i"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# extract zips if they exist
|
|
||||||
# count_zips=$(ls -1 "$WORKDIR"/xml/*.zip 2>/dev/null | wc -l)
|
|
||||||
mapfile -t count_zips < <(find "$WORKDIR"/xml/ -maxdepth 1 -name "*.zip" -type f)
|
|
||||||
if [ "${#count_zips[@]}" -gt 0 ]; then
|
|
||||||
extract-zips
|
|
||||||
fi
|
|
||||||
# extract tars if they exist
|
|
||||||
# count_tars=$(ls -1 "$WORKDIR"/xml/*.tar.gz 2>/dev/null | wc -l)
|
|
||||||
mapfile -t count_tars < <(find "$WORKDIR"/xml/ -maxdepth 1 -name "*.tar.gz" -type f)
|
|
||||||
if [ "${#count_tars[@]}" -gt 0 ]; then
|
|
||||||
extract-tars
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "converting reports to html"
|
echo "converting reports to html"
|
||||||
dmarc-report-converter
|
dmarc-report-converter
|
||||||
echo "open filewall port"
|
echo "open filewall port"
|
||||||
|
|
Loading…
Reference in New Issue