aboutsummaryrefslogtreecommitdiffstats
path: root/setup-apklbu.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-09-13 13:56:54 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-09-13 14:54:11 +0000
commit554dd8a46183be92961965dcbacd022236f4e7b3 (patch)
treef9836b05d7d39fb59183c1dd62e79f073dda853d /setup-apklbu.in
parent2d40c0f4649bb3713283d210707f3fdf34cf1ddd (diff)
downloadalpine-conf-554dd8a46183be92961965dcbacd022236f4e7b3.tar.bz2
alpine-conf-554dd8a46183be92961965dcbacd022236f4e7b3.tar.xz
setup-apkcache: new setup tool
A tool to setup the apk cache. This and setup-lbu replaces the setup-apklbu tool.
Diffstat (limited to 'setup-apklbu.in')
-rwxr-xr-xsetup-apklbu.in84
1 files changed, 0 insertions, 84 deletions
diff --git a/setup-apklbu.in b/setup-apklbu.in
deleted file mode 100755
index ff1ff0a..0000000
--- a/setup-apklbu.in
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-
-PREFIX=
-
-. "$PREFIX/lib/libalpine.sh"
-
-usage() {
- cat <<__EOF__
-usage: setup-apklbu [-hi] [-m relative mountpoint]
-
-Setup apk caching and lbu settings.
-
-options:
- -h Show this help
- -i Run in installer mode (usually only when called by setup-alpine)
- -m Specify mountpoint under /media for lbu backups (default is usb)
-__EOF__
- exit 1
-}
-
-
-while getopts "im:h" opt; do
- case $opt in
- i) VERBOSE="1";;
- h) usage;;
- m) MOUNTPOINT="$OPTARG";;
- esac
-done
-
-if [ "$VERBOSE" = "1" ]; then
- echo "Setup apk caching and lbu? (y/N)"
- default_read setupapklbu
- if [ "$setupapklbu" = "N" ] || [ "$setupapklbu" = "n" ]; then
- exit 0
- fi
- if [ -z $MOUNTPOINT ]; then
- MOUNTPOINT="usb"
- echo "Please enter mountpoint directory under /media for lbu [$MOUNTPOINT]:"
- default_read MOUNTPOINT "$MOUNTPOINT"
- fi
-fi
-
-if [ -z $MOUNTPOINT ]; then
- MOUNTPOINT="usb"
-fi
-
-mountstatus="`mount | grep /media/${MOUNTPOINT}`"
-
-if [ -z $mountstatus ]; then
- echo "$MOUNTPOINT is not mounted" && exit 1
-fi
-
-readwritestatus="`echo $mountstatus | awk -F '(' '{print $2}' | awk -F ',' '{print $1}'`"
-
-if [ "$readwritestatus" = "ro" ]; then
- rewrite=1
-fi
-
-if [ "$rewrite" = 1 ]; then
- mount -o remount,rw /media/${MOUNTPOINT} || die "Failed to remount media rw"
-fi
-
-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"
-apk cache sync
-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
-if [ "$rewrite" = 1 ]; then
- mount -o remount,ro /media/${MOUNTPOINT} || die "Failed to remount media ro"
-fi