Skip to content

Instantly share code, notes, and snippets.

@cgobat
Last active March 21, 2024 11:57
Show Gist options
  • Save cgobat/c35a9f8767fd8f98bbc33f82080c39d6 to your computer and use it in GitHub Desktop.
Save cgobat/c35a9f8767fd8f98bbc33f82080c39d6 to your computer and use it in GitHub Desktop.
Alpine Linux setup tools
# Answer file for setup-alpine script on MilkV Duo
# Use US layout with US variant
KEYMAPOPTS="us us"
# Set hostname to 'alpine'
HOSTNAMEOPTS="milkv-duo"
# Contents of /etc/network/interfaces
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
"
# Search domain of example.com, quad9
# DNSOPTS="-d example.com 9.9.9.9"
# Set timezone to UTC
TIMEZONEOPTS="UTC"
# set http/ftp proxy
PROXYOPTS=none
# Add first mirror (CDN)
APKREPOSOPTS="-1"
# Configure SSH
SSHDOPTS=dropbear
# Use chrony for NTP
NTPOPTS="chrony"
# Use /dev/sda as a sys disk
# DISKOPTS="-m sys /dev/sda"
DISKOPTS=none
#APKCACHEOPTS="/media/LABEL=APKOVL/cache"
APKCACHEOPTS=none
#!/usr/bin/env bash
if [ $USER != 'root' ]; then
echo "Run this script as root!"
exit
fi
SCRIPT_DIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
echo "Updating & upgrading APK packages..."
# --no-check-certificate is necessary prior to time sync
apk update --no-check-certificate
apk upgrade --no-check-certificate
echo "Installing alpine-conf package..."
apk add --no-check-certificate alpine-conf
echo "Installation complete. Running setup-alpine -f $SCRIPT_DIR/alpine-conf.answers"
setup-alpine -f $SCRIPT_DIR/alpine-conf.answers
echo "Current system time is $(date)"
while true
do
read -p "Setup complete. Reboot? [Y/N] " reboot_now
if [ $reboot_now = 'n' ] || [ $reboot_now = 'N' ]; then
exit
elif [ $reboot_now = 'y' ] || [ $reboot_now = 'Y' ]; then
reboot
else
echo "Choose Y/N"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment