small fixes

This commit is contained in:
2023-04-29 08:25:51 +02:00
parent e1bde27789
commit c3082c9442
8 changed files with 74 additions and 73 deletions

18
scan
View File

@ -1,9 +1,15 @@
#!/usr/bin/env bash
export DIR="$(dirname -- "$0")"
config="$1"
if [ "$#" -ne 1 ]; then
echo "Usage: ./scan <config>" >&2
exit 1
fi
site="$(basename ${config/.yaml/})"
php to_XML.php "$config" > "$DIR/site/$site.xml"
xsltproc nmap_cmd.xsl "$DIR/site/$site.xml" | sh
mv "$DIR/scans/$site.xml.tmp" "$DIR/scans/$site.xml"
pushd "$(dirname -- "$0")" > /dev/null
site="$(basename ${1/.yaml/})"
php "to_XML.php" "configs/$site.yaml" > "site/$site.xml"
eval $(xsltproc "nmap_cmd.xsl" "site/$site.xml")
mv "scans/$site.xml.tmp" "scans/$site.xml"
popd > /dev/null