mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-02-14 17:49:53 +00:00
WIP feroxbuster
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
##################
|
||||
#######################
|
||||
# Install feroxbuster #
|
||||
##################
|
||||
#######################
|
||||
|
||||
# Every package should define these variables
|
||||
$pkg_cmd_name = "feroxbuster"
|
||||
@@ -15,47 +15,41 @@ $pkg_src_bin = "$Env:USERPROFILE\.local\opt\feroxbuster-v$Env:WEBI_VERSION\bin"
|
||||
$pkg_src_dir = "$Env:USERPROFILE\.local\opt\feroxbuster-v$Env:WEBI_VERSION"
|
||||
$pkg_src = "$pkg_src_cmd"
|
||||
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | out-null
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"))
|
||||
{
|
||||
echo "Downloading feroxbuster from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
IF (!(Test-Path -Path "$pkg_download")) {
|
||||
Write-Host "Downloading feroxbuster from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& move "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
{
|
||||
echo "Installing feroxbuster"
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Verbose "Installing feroxbuster"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
# Enter tmp
|
||||
pushd .local\tmp
|
||||
|
||||
# Remove any leftover tmp cruft
|
||||
Remove-Item -Path ".\feroxbuster-v*" -Recurse -ErrorAction Ignore
|
||||
Remove-Item -Path ".\feroxbuster.exe" -Recurse -ErrorAction Ignore
|
||||
# Remove any leftover tmp cruft
|
||||
Remove-Item -Path ".\feroxbuster-v*" -Recurse -ErrorAction Ignore
|
||||
Remove-Item -Path ".\feroxbuster.exe" -Recurse -ErrorAction Ignore
|
||||
|
||||
# NOTE: DELETE THIS COMMENT IF NOT USED
|
||||
# Move single binary into root of temporary folder
|
||||
#& move "$pkg_download" "feroxbuster.exe"
|
||||
# Unpack archive file into this temporary directory
|
||||
# Windows BSD-tar handles zip. Imagine that.
|
||||
Write-Verbose "Unpacking $pkg_download"
|
||||
& tar xf "$pkg_download"
|
||||
|
||||
# Unpack archive file into this temporary directory
|
||||
# Windows BSD-tar handles zip. Imagine that.
|
||||
echo "Unpacking $pkg_download"
|
||||
& tar xf "$pkg_download"
|
||||
|
||||
# Settle unpacked archive into place
|
||||
echo "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force | out-null
|
||||
Move-Item -Path ".\feroxbuster-*\feroxbuster.exe" -Destination "$pkg_src_bin"
|
||||
# Settle unpacked archive into place
|
||||
Write-Verbose "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force | Out-Null
|
||||
Move-Item -Path ".\feroxbuster-*\feroxbuster.exe" -Destination "$pkg_src_bin"
|
||||
|
||||
# Exit tmp
|
||||
popd
|
||||
}
|
||||
|
||||
echo "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'"
|
||||
Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore | out-null
|
||||
Write-Host "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'"
|
||||
Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore | Out-Null
|
||||
Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
|
||||
|
||||
Reference in New Issue
Block a user