aboutsummaryrefslogtreecommitdiffstats
path: root/main/util-vserver/setup-vs-template
diff options
context:
space:
mode:
Diffstat (limited to 'main/util-vserver/setup-vs-template')
-rw-r--r--main/util-vserver/setup-vs-template45
1 files changed, 0 insertions, 45 deletions
diff --git a/main/util-vserver/setup-vs-template b/main/util-vserver/setup-vs-template
deleted file mode 100644
index 3edffa1aaa..0000000000
--- a/main/util-vserver/setup-vs-template
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-# create a vserver template
-PROG=$0
-
-usage() {
- echo "usage: $PROG [-fhq] [-o OUTFILE] [-X repository] [packages...]"
- exit $1
-}
-
-clean_exit() {
- rm -rf "$tmpdir"
- exit $1
-}
-
-outfile=template.tar.gz
-fakeroot=
-repos=
-while getopts "a:ho:qX:" opt; do
- case "$opt" in
- a) arch_opt="--arch $OPTARG";;
- h) usage 0;;
- o) outfile="$OPTARG";;
- q) quiet=-q;;
- X) repos="$repos --repository $OPTARG";;
- esac
-done
-shift $(( $OPTIND - 1 ))
-
-if [ "$(whoami)" != "root" ]; then
- echo "Warning: you need root permissions" >&2
-fi
-
-tmpdir=$(mktemp -d ${TMPDIR:-/tmp}/setup-vs-template-XXXXXX)
-
-apk add --root "$tmpdir" --initdb --keys-dir /etc/apk/keys -U $arch_opt \
- $quiet ${repos:---repositories-file /etc/apk/repositories} \
- alpine-base $@ \
- || clean_exit 1
-
-tar -czf "$outfile" -C "$tmpdir" $(ls "$tmpdir") || clean_exit 1
-
-[ -z "$quiet" ] && echo "Created $outfile"
-clean_exit 0
-