joininbox/scripts/prepare.release.sh

35 lines
1 KiB
Bash
Raw Normal View History

#!/bin/bash
# based on https://github.com/rootzoll/raspiblitz/blob/v1.6/home.admin/XXprepareRelease.sh
# Run this script once after a fresh sd card build
# to prepare the image for release as a downloadable sd card image
2021-02-10 18:50:23 +00:00
# SSH authorized keys
echo "# Deleting SSH authorized_keys ..."
sudo rm /root/.ssh/authorized_keys
echo "# OK"
# SSH Pubkeys (make unique for every sd card image install)
2021-02-10 18:50:23 +00:00
echo "# Deleting SSH Pub keys ..."
echo "they will get recreated on fresh bootup, by the bootstrap.service"
sudo rm /etc/ssh/ssh_host_*
2021-02-10 18:50:23 +00:00
echo "# OK"
# https://github.com/rootzoll/raspiblitz/issues/1068#issuecomment-599267503
echo
2021-02-10 18:50:23 +00:00
echo "# Deleting local DNS confs ..."
sudo rm /etc/resolv.conf
2021-02-10 18:50:23 +00:00
echo "# OK"
# https://github.com/rootzoll/raspiblitz/issues/1371
echo
2021-02-10 18:50:23 +00:00
echo "# Deleting local WIFI conf ..."
sudo rm /boot/wpa_supplicant.conf 2>/dev/null
2021-02-10 18:50:23 +00:00
echo "# OK"
echo
2021-02-10 18:50:23 +00:00
echo "# Will shutdown now."
echo "# Wait until the SBC LEDs show no activity anymore."
echo "# Then remove SD card and make a release image from it."
sudo shutdown now