From: AJ ONeal Date: Tue, 30 Jun 2020 19:15:31 +0000 (+0000) Subject: powershell updates X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=17924e670fd56fa31ac6ebee8d8d7ee30b547358;p=webi-installers%2F.git powershell updates --- diff --git a/_webi/bootstrap.ps1 b/_webi/bootstrap.ps1 index 8ec299c..168c457 100644 --- a/_webi/bootstrap.ps1 +++ b/_webi/bootstrap.ps1 @@ -23,14 +23,15 @@ pushd .local\bin # TODO SetStrictMode # TODO Test-Path variable:global:Env:WEBI_HOST ??? -IF(!($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "")) { +IF($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" } # Fetch webi.bat -Invoke-WebRequest "$Env:WEBI_HOST/packages/_webi/webi.ps1.bat" -OutFile webi.bat -Invoke-WebRequest "$Env:WEBI_HOST/packages/_webi/webi.ps1" -OutFile webi.ps1 +echo "$Env:WEBI_HOST/packages/_webi/webi.ps1" +curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1.bat" -o webi.bat +curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1" -o webi.ps1 popd diff --git a/_webi/webi.ps1 b/_webi/webi.ps1 index 21a4e95..1a961fc 100644 --- a/_webi/webi.ps1 +++ b/_webi/webi.ps1 @@ -30,7 +30,7 @@ if (!(Test-Path -Path .local\tmp)) # TODO SetStrictMode # TODO Test-Path variable:global:Env:WEBI_HOST ??? -IF(!$Env:WEBI_HOST) +IF($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" } diff --git a/ssh-utils/ssh-pubkey.ps1 b/ssh-utils/ssh-pubkey.ps1 index 3af6a59..46838e3 100644 --- a/ssh-utils/ssh-pubkey.ps1 +++ b/ssh-utils/ssh-pubkey.ps1 @@ -6,23 +6,23 @@ if (!(Test-Path -Path "$Env:USERPROFILE/.ssh")) { New-Item -Path "$Env:USERPROFILE/.ssh" -ItemType Directory - & icacls "$Env:USERPROFILE/.ssh" /inheritance:r - & icacls "$Env:USERPROFILE/.ssh" /grant:r "%username%":"(F)" + #& icacls "$Env:USERPROFILE/.ssh" /inheritance:r + #& icacls "$Env:USERPROFILE/.ssh" /grant:r "$Env:USERNAME":"(F)" } if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/config")) { New-Item -Path "$Env:USERPROFILE/.ssh/config" -ItemType "file" -Value "" - & icacls "$Env:USERPROFILE/.ssh/config" /inheritance:r - & icacls "$Env:USERPROFILE/.ssh/config" /grant:r "%username%":"(F)" + #& icacls "$Env:USERPROFILE/.ssh/config" /inheritance:r + #& icacls "$Env:USERPROFILE/.ssh/config" /grant:r "$Env:USERNAME":"(F)" } -if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/authorized_keys")) -{ - New-Item -Path "$Env:USERPROFILE/.ssh/authorized_keys" -ItemType "file" -Value "" - & icacls "$Env:USERPROFILE/.ssh/authorized_keys" /inheritance:r - & icacls "$Env:USERPROFILE/.ssh/authorized_keys" /grant:r "%username%":"(F)" -} +#if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/authorized_keys")) +#{ +# New-Item -Path "$Env:USERPROFILE/.ssh/authorized_keys" -ItemType "file" -Value "" +# #& icacls "$Env:USERPROFILE/.ssh/authorized_keys" /inheritance:r +# #& icacls "$Env:USERPROFILE/.ssh/authorized_keys" /grant:r "$Env:USERNAME":"(F)" +#} if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/id_rsa")) { diff --git a/vps-myip/install.ps1 b/vps-myip/install.ps1 index 2cde75e..0d3c744 100644 --- a/vps-myip/install.ps1 +++ b/vps-myip/install.ps1 @@ -2,12 +2,14 @@ $ipv4 = curl.exe -sf https://api.ipify.org -IF(!($ipv4 -eq $null -or $ipv4 -eq "")) { +IF(!($ipv4 -eq $null -or $ipv4 -eq "")) +{ echo "IPv4 (A) : $ipv4" } $ipv6 = curl.exe -sf https://api6.ipify.org -IF(!($ipv6 -eq $null -or $ipv6 -eq "")) { +IF(!($ipv6 -eq $null -or $ipv6 -eq "")) +{ echo "IPv6 (AAAA): $ipv6" }