diff --git a/GetShellWithoutMonitorOnLinux.md b/GetShellWithoutMonitorOnLinux.md index 88d0522..2013114 100644 --- a/GetShellWithoutMonitorOnLinux.md +++ b/GetShellWithoutMonitorOnLinux.md @@ -20,7 +20,7 @@ If you prefer not to run the script, it's also a useful reference for the steps 1. Run the following commands: ``` wget https://raw.githubusercontent.com/cimryan/teslausb/master/mac_linux_archive/setup-piForHeadlessConfig.sh - chmod +x update-rpi-mac-linux.sh + chmod +x setup-piForHeadlessConfig.sh ``` 1. Set your SSID (Wifi network name) and WIFIPASS environment variables. The script will insert them into the `wpa_supplicant.conf` when creating it: @@ -29,7 +29,7 @@ If you prefer not to run the script, it's also a useful reference for the steps export WIFIPASS=your_wifi_password_here ``` 1. Run the script: - `./update-rpi-mac-linux.sh` + `./setup-piForHeadlessConfig.sh` 1. If all goes well, the script will report: `-- Files updated and ready for Wifi and SSH over USB --` 1. Eject the SD card safely, insert into your Pi, and reboot. If the Pi is connected over USB to your host, and/or if the Wifi setup went correctly, you should be able to `ssh pi@raspberrypi.local`. The default password is `raspberry`. diff --git a/windows_archive/setup-piForHeadlessConfig.ps1 b/windows_archive/setup-piForHeadlessConfig.ps1 index 972bbbc..d2a1eea 100644 --- a/windows_archive/setup-piForHeadlessConfig.ps1 +++ b/windows_archive/setup-piForHeadlessConfig.ps1 @@ -44,14 +44,18 @@ if ([System.IO.File]::Exists("$wpaSupplicantConfPath")) { del "$wpaSupplicantConfPath" } -"ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev` -update_config=1` -` -network={` - ssid=`"$wifiSSID`"` - psk=`"$wifiPSK`"` - key_mgmt=WPA-PSK` -}` -" | Out-File -FilePath "$wpaSupplicantConfPath" -Encoding utf8 +$wpaSupplicantConfContent=@" +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev +update_config=1 + +network={ + ssid="$wifiSSID" + psk="$wifiPSK" +} +"@ + +$utf8 = New-Object System.Text.UTF8Encoding $false + +Set-Content -Value $utf8.GetBytes($wpaSupplicantConfContent) -Encoding Byte -Path "$wpaSupplicantConfPath" Write-Verbose "All done." \ No newline at end of file diff --git a/windows_archive/setup-teslausb b/windows_archive/setup-teslausb index f72dc25..5910eab 100644 --- a/windows_archive/setup-teslausb +++ b/windows_archive/setup-teslausb @@ -4,7 +4,6 @@ REPO=cimryan BRANCH=master user_enabled_pushover=false - if ! [ $(id -u) = 0 ] then echo "STOP: Run sudo -i." @@ -43,8 +42,6 @@ function check_pushover_enabled () { fi } -check_pushover_enabled - function check_archive_server_reachable () { echo "Verifying that the archive server $archiveserver is reachable..." local serverunreachable=false