21y4d / nmapAutomator

A script that you can run in the background!
MIT License
2.67k stars 790 forks source link

Create nmapAutomator-macos.sh #76

Open rc042 opened 7 months ago

rc042 commented 7 months ago

Update nmapAutomator.sh to be compatible with MacOS Sonoma 14.2.1 (tmp file issue)

The modification could solve https://github.com/21y4d/nmapAutomator/issues/68

rc042 commented 7 months ago

The changes were:

nmapProgressBar() {
        refreshRate="${2:-1}"
        outputFile="$(echo $1 | gsed -e 's/.*-oN \(.*\).nmap.*/\1/').nmap"
        # tmpOutputFile="${outputFile}.tmp"                           # Commented
        baseDir=$(dirname "${outputFile}")                            # NEW
        baseName=$(basename "${outputFile}" .nmap)                    # NEW
        tmpOutputFile="${baseDir}/${baseName}.tmp"                    # NEW

And I use gsed instead sed on MacOS