Skip to content

Instantly share code, notes, and snippets.

@chrisguest75
Last active November 4, 2018 18:22
Show Gist options
  • Select an option

  • Save chrisguest75/f3a75198d19821b192aed29749e3af0f to your computer and use it in GitHub Desktop.

Select an option

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.
#!/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