summaryrefslogtreecommitdiff
path: root/setup-apklbu.in
diff options
context:
space:
mode:
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