Skip to content

Instantly share code, notes, and snippets.

@ruzickap
Last active October 15, 2022 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruzickap/c7242fcbcbe403430f28881eef148539 to your computer and use it in GitHub Desktop.
Save ruzickap/c7242fcbcbe403430f28881eef148539 to your computer and use it in GitHub Desktop.
Script for quick installation of RaspAP
#!/bin/bash -eux
DEVICE="sdc"
lsblk --output NAME,MODEL,MODEL | grep ${DEVICE}
read -r -p "Press enter to remove everything from ${DEVICE}"
curl -L https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-09-26/2022-09-22-raspios-bullseye-arm64-lite.img.xz | xzcat | sudo dd of=/dev/${DEVICE} bs=4M
sudo partprobe /dev/${DEVICE}
MYTMP=$(mktemp --directory)
sudo mount /dev/${DEVICE}1 "${MYTMP}"
sudo touch "${MYTMP}/ssh"
sudo umount "${MYTMP}"
sudo mount "/dev/${DEVICE}2" "${MYTMP}"
# sudo bash -c "cat >> ${MYTMP}/etc/dhcpcd.conf" << EOF
# interface eth0
# static ip_address=192.168.1.2/24
# static routers=192.168.1.1
# static domain_name_servers=1.1.1.1
# EOF
sudo sed -i '/^exit/i rfkill unblock 0 ; curl -sL https://install.raspap.com | bash -s -- --yes 2>&1 | tee /var/tmp/raspap.log ; sed -i /raspap/d /etc/rc.local ; reboot' "${MYTMP}/etc/rc.local"
sudo umount "${MYTMP}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment