diff --git a/assets/IspInfo/getispinfo.ps1 b/assets/IspInfo/getispinfo.ps1 index c86be6c..23fd6e1 100644 --- a/assets/IspInfo/getispinfo.ps1 +++ b/assets/IspInfo/getispinfo.ps1 @@ -6,7 +6,7 @@ Write-Output "Downloading the ISP list..." Set-Variable ISPS ((Invoke-WebRequest -Uri $DATABASEADDRESS).links.href | Select-Object -Skip 5) $ISPS | ForEach-Object -Process { - Set-Variable XMLFILE "$PWD\$_.xml" + Set-Variable XMLFILE "$PSScriptRoot\$_.xml" Write-Output "Saving ISP info $_ to $XMLFILE..." Invoke-WebRequest $DATABASEADDRESS$_ -OutFile $XMLFILE $a = Get-Content $XMLFILE diff --git a/assets/IspInfo/getispinfo.sh b/assets/IspInfo/getispinfo.sh index 22ce955..2be1497 100644 --- a/assets/IspInfo/getispinfo.sh +++ b/assets/IspInfo/getispinfo.sh @@ -3,6 +3,7 @@ # Some variables DATABASEADDRESS=https://autoconfig.thunderbird.net/v1.1/ DBFILE=$(mktemp) +ROOT=$(dirname "$0") GREEN=$(tput setaf 2) RED=$(tput setaf 1) RESET=$(tput sgr0) @@ -24,7 +25,7 @@ for ISPIDX in "${!ISPS[@]}" do ISP=${ISPS[ISPIDX]} ISPADDRESS=$DATABASEADDRESS$ISP - OUTPUTFILE=$ISP.xml + OUTPUTFILE=$ROOT/$ISP.xml # Download configuration information printf "[$((ISPIDX+1)) of $ISPCOUNT] Downloading $GREEN$ISPADDRESS$RESET...\n" @@ -41,4 +42,4 @@ do done # Done. User can now build Nettify. -printf "${GREEN}Done!$RESET\n" \ No newline at end of file +printf "${GREEN}Done!$RESET\n"