Commit cbd70659 authored by Jeff Bilyk's avatar Jeff Bilyk

setup-alpine: populate setup script answer file example

parent e489e81f
......@@ -51,16 +51,44 @@ fi
if [ "$CREATEANSWERFILE" != "" ]; then
touch "$CREATEANSWERFILE" || echo "Cannot touch file $CREATEANSWERFILE"
cat <<__EOF__ > "$CREATEANSWERFILE"
KEYMAPOPTS=""
HOSTNAMEOPTS=""
INTERFACESOPTS=""
DNSOPTS=""
TIMEZONEOPTS=""
APKREPOSOPTS=""
SSHDOPTS=""
NTPOPTS=""
DISKOPTS=""
APKLBUOPTS=""
# Example answer file for setup-alpine script
# If you don't want to use a certain option, then comment it out
# Use US layout with US variant
KEYMAPOPTS="us us"
# Set hostname to alpine-test
HOSTNAMEOPTS="-n alpine-test"
# Contents of /etc/network/interfaces
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine-test
"
# Search domain of example.com, Google public nameserver
DNSOPTS="-d example.com -n 8.8.8.8"
# Set timezone to UTC
TIMEZONEOPTS="-z UTC"
# Add a random mirror
APKREPOSOPTS="-r"
# Install Openssh
SSHDOPTS="-c openssh"
# Use openntpd
NTPOPTS="-c openntpd"
# Use /dev/sda as a data disk
DISKOPTS="-m data /dev/sda"
# Setup in /media/sdb1
APKLBUOPTS="-m sdb1"
__EOF__
echo "Answer file $CREATEANSWERFILE has been created. Please add or remove options as desired in that file"
exit 0
......@@ -75,7 +103,12 @@ fi
$PREFIX/sbin/setup-keymap ${KEYMAPOPTS}
$PREFIX/sbin/setup-hostname ${HOSTNAMEOPTS}
$PREFIX/sbin/setup-interfaces ${INTERFACEOPTS}
if [ -n "$INTERFACESOPTS" ]; then
printf "$INTERFACESOPTS" | $PREFIX/sbin/setup-interfaces -i
else
$PREFIX/sbin/setup-interfaces
fi
# setup up dns if no dhcp was configured
grep '^iface.*dhcp' $ROOT/etc/network/interfaces > /dev/null ||\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment