Last active
November 4, 2018 18:22
-
-
Save chrisguest75/f3a75198d19821b192aed29749e3af0f to your computer and use it in GitHub Desktop.
USE AT OWN RISK: After writing Raspbian Image insert SD card into Ubuntu machine and run script to enable SSH on first boot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| stat /media/$(whoami)/boot | |
| result=$? | |
| if [[ "${result}" -eq "1" ]]; then | |
| echo "Disk is not inserted" | |
| exit 1 | |
| fi | |
| sudo touch /media/$(whoami)/boot/ssh | |
| sleep 2 | |
| udisksctl unmount -b /dev/mmcblk0p1 | |
| udisksctl unmount -b /dev/mmcblk0p2 | |
| sleep 2 | |
| udisksctl power-off -b /dev/mmcblk0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment