Skip to content

Instantly share code, notes, and snippets.

@pmoranga
Created December 23, 2019 20:08
Show Gist options
  • Save pmoranga/da95f7a7e1c658074328996896fa09ee to your computer and use it in GitHub Desktop.
Save pmoranga/da95f7a7e1c658074328996896fa09ee to your computer and use it in GitHub Desktop.
#!/bin/bash
H=${1:-rpi.example.com}
flash --hostname ${H} --userdata rpi-boot-wifi.yaml https://github.com/hypriot/image-builder-rpi/releases/download/v1.11.5/hypriotos-rpi-v1.11.5.img.zip
#cloud-config
# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
hostname: my-rpi.local
manage_etc_hosts: true
# You could modify this for your own user information
users:
- name: pirate
gecos: "Hypriot Pirate"
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
groups: users,docker,video
plain_text_passwd: hypriot
lock_passwd: false
ssh_pwauth: true
chpasswd: { expire: false }
package_upgrade: false
# # WiFi connect to HotSpot
# # - use `wpa_passphrase SSID PASSWORD` to encrypt the psk
write_files:
- content: |
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "SSID"
wpa-psk "PASSWORD"
path: /etc/network/interfaces.d/wlan0
# These commands will be ran once on first boot only
runcmd:
# Pickup the hostname changes
- 'timedatectl set-timezone Europe/Amsterdam'
- 'systemctl restart avahi-daemon'
# Activate WiFi interface
- 'ifup wlan0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment