aboutsummaryrefslogtreecommitdiffstats
path: root/setup-apklbu.in
diff options
context:
space:
mode:
authorJeff Bilyk <jbilyk@gmail.com>2011-06-08 22:16:14 +0000
committerJeff Bilyk <jbilyk@gmail.com>2011-06-08 22:16:14 +0000
commit5ac7203533034845fed9ea4b7718e91ab58b2a7f (patch)
tree9a1229c12c402bf0032264d28e151457038b51c2 /setup-apklbu.in
parent6dbbe28a459e79acb9e7ba44d43295df9a0f45f8 (diff)
downloadalpine-conf-5ac7203533034845fed9ea4b7718e91ab58b2a7f.tar.bz2
alpine-conf-5ac7203533034845fed9ea4b7718e91ab58b2a7f.tar.xz
setup-apklbu: new script
setup-apklbu is a new script for setting up apk cache and lbu
Diffstat (limited to 'setup-apklbu.in')
-rwxr-xr-xsetup-apklbu.in38
1 files changed, 38 insertions, 0 deletions
diff --git a/setup-apklbu.in b/setup-apklbu.in
new file mode 100755
index 0000000..91aac54
--- /dev/null
+++ b/setup-apklbu.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+PREFIX=
+
+. "$PREFIX/lib/libalpine.sh"
+
+echo "Setup apk caching and lbu? (y/N)"
+default_read setupapklbu
+
+if [ "$setupapklbu" == "Y" ] || [ "$setupapklbu" == "y" ]; then
+ continue=1
+fi
+
+if [ -z $continue ]; then
+ exit 0
+fi
+
+mountpoint="usb"
+echo "Please enter mountpoint directory under /media for lbu ($mountpoint):"
+default_read mountpoint "$mountpoint"
+mkdir -p /media/${mountpoint}/cache || die "Failed to create /media/${mountpoint}/cache"
+ln -s /media/${mountpoint}/cache /etc/apk/cache || die "Failed to create apk cache softlink"
+cat > /etc/lbu/lbu.conf <<EOF
+# what cipher to use with -e option
+DEFAULT_CIPHER=aes-256-cbc
+
+# Uncomment the row below to encrypt config by default
+# ENCRYPTION=$DEFAULT_CIPHER
+
+# Uncomment below to avoid <media> option to 'lbu commit'
+# Can also be set to 'floppy'
+LBU_MEDIA=$mountpoint
+
+# Uncomment below to let lbu make up to 3 backups
+# BACKUP_LIMIT=3
+EOF
+lbu package /media/"$mountpoint" || die "Failed to lbu apkovl on /media/${mountpoint}"
+sync