aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--setup-alpine.in6
-rwxr-xr-xsetup-apkrepos.in35
3 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0046928..c4f9555 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,7 @@ SBIN_FILES := lbu\
setup-ads\
setup-alpine\
setup-alpine-web\
+ setup-apkrepos\
setup-cryptswap\
setup-disk\
setup-dns\
diff --git a/setup-alpine.in b/setup-alpine.in
index 8d1aa0f..29bb868 100644
--- a/setup-alpine.in
+++ b/setup-alpine.in
@@ -67,3 +67,9 @@ _hn=${_hn%%.*}
sed -i -e "s/^127\.0\.0\.1.*/127.0.0.1\t${_hn}.${_dn:-$(get_fqdn)} ${_hn} localhost.localdomain localhost/" /etc/hosts
+printf "Setup internet apk repositories? [y/N]?"
+default_read setuprepos "n"
+
+if [ $setuprepos == "Y" ] || [ $setuprepos == "y" ]; then
+ $PREFIX/sbin/setup-apkrepos
+fi
diff --git a/setup-apkrepos.in b/setup-apkrepos.in
new file mode 100755
index 0000000..1436292
--- /dev/null
+++ b/setup-apkrepos.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+PROGRAM=setup-apkrepos
+PREFIX=
+
+. $PREFIX/lib/libalpine.sh
+
+while true; do
+ printf "Enter repository branch : \n"
+ printf "1 1.10 \n"
+ printf "2 2.0\n"
+ printf "3 2.1\n"
+ printf "4 edge\n"
+ default_read REPO "3"
+ if [ $REPO -gt 0 ] && [ $REPO -lt 5 ]; then
+ break
+ fi
+done
+if [ $REPO == 1 ]; then
+ echo "v1.10 repos selected"
+ echo "http://dl-3.alpinelinux.org/alpine/v1.10/packages/main" >> /etc/apk/repositories
+ apk update
+elif [ $REPO == 2 ]; then
+ echo "v2.0 repos selected";
+ echo "http://dl-3.alpinelinux.org/alpine/v2.0/packages/main" >> /etc/apk/repositories
+ apk update
+elif [ $REPO == 3 ]; then
+ echo "v2.1 repos selected";
+ echo "http://dl-3.alpinelinux.org/alpine/v2.1/packages/main" >> /etc/apk/repositories
+ apk update
+elif [ $REPO == 4 ]; then
+ echo "edge repos selected";
+ echo "http://dl-3.alpinelinux.org/alpine/edge/packages/main" >> /etc/apk/repositories
+ apk update
+fi