summaryrefslogtreecommitdiffstats
path: root/share/get-scripts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xshare/get-scripts/curl (renamed from share/scripts/curl)24
-rwxr-xr-xshare/get-scripts/curl.d/0001-debconf (renamed from share/scripts/curl.d/0001-debconf)0
-rw-r--r--share/get-scripts/curl.d/0001-debconf.templates (renamed from share/scripts/curl.d/0001-debconf.templates)2
3 files changed, 12 insertions, 14 deletions
diff --git a/share/scripts/curl b/share/get-scripts/curl
index 98c2b82..4accea2 100755
--- a/share/scripts/curl
+++ b/share/get-scripts/curl
@@ -23,13 +23,12 @@ PROJECT="open-infrastructure"
SOFTWARE="compute-tools"
PROGRAM="container"
+SCRIPT="${0}"
+export SCRIPT
+
HOOKS="/etc/${SOFTWARE}/hooks"
KEYS="/etc/${SOFTWARE}/keys"
MACHINES="/var/lib/machines"
-CACHE="/var/cache/${PROGRAM}/system"
-
-SCRIPT="${0}"
-export SCRIPT
Parameters ()
{
@@ -124,7 +123,7 @@ Parameters ()
Usage ()
{
- echo "Usage: container create -n|--name NAME -s|--script ${SCRIPT} -- [--clean] [-p|--password PASSWORD] [--server SERVER] [--setup SETUP] [--system SYSTEM]" >&2
+ echo "Usage: container get -n|--name NAME -s|--script ${SCRIPT} -- [--clean] [-p|--password PASSWORD] [--server SERVER] [--setup SETUP] [--system SYSTEM]" >&2
exit 1
}
@@ -178,11 +177,10 @@ fi
SERVER="${SERVER:-https://get.open-infrastructure.net/system/container/debian}"
PASSWORD="${PASSWORD:-$(dd if=/dev/urandom bs=12 count=1 2> /dev/null | base64)}"
+CACHE="/var/cache/${PROGRAM}/get-$(basename ${SCRIPT})/$(echo ${SERVER} | sed -e 's|.*//||' -e 's|/|_|g')"
VERSION="$(container version)"
-export SERVER
-
Debconf ()
{
# Configure local debconf
@@ -269,7 +267,7 @@ then
Debconf
# Run debconf parts
- for DEBCONF_SCRIPT in /usr/share/${SOFTWARE}/scripts/curl.d/*
+ for DEBCONF_SCRIPT in /usr/share/${SOFTWARE}/get-scripts/curl.d/*
do
if [ -x "${DEBCONF_SCRIPT}" ]
then
@@ -300,14 +298,14 @@ mkdir -p "${CACHE}"
SETUP="${SETUP:-$(echo ${SYSTEM} | sed -e 's|.system.tar.|.setup.tar.|')}"
-for FILE in "${SYSTEM}" "${SYSTEM}.sign" "${SYSTEM}.sha512" \
- "${SETUP}" "${SETUP}.sign" "${SETUP}.sha512"
+for FILE in "${SYSTEM}" "${SYSTEM}.sig" "${SYSTEM}.sha512" \
+ "${SETUP}" "${SETUP}.sig" "${SETUP}.sha512"
do
if curl --fail --head --output /dev/null --silent "${SERVER}/${FILE}"
then
case "${FILE}" in
*.sha512)
- if [ -e "${CACHE}/$(basename ${FILE} .sha512).sign" ]
+ if [ -e "${CACHE}/$(basename ${FILE} .sha512).sig" ]
then
continue
fi
@@ -336,12 +334,12 @@ do
continue
fi
- if [ -e "${FILE}.sign" ]
+ if [ -e "${FILE}.sig" ]
then
echo -n "Verifying ${FILE}:"
set +e
- gpg --homedir "${KEYS}" --verify "${FILE}.sign" "${FILE}" > /dev/null 2>&1
+ gpg --homedir "${KEYS}" --verify "${FILE}.sig" "${FILE}" > /dev/null 2>&1
GNUPG="${?}"
set -e
diff --git a/share/scripts/curl.d/0001-debconf b/share/get-scripts/curl.d/0001-debconf
index 083d469..083d469 100755
--- a/share/scripts/curl.d/0001-debconf
+++ b/share/get-scripts/curl.d/0001-debconf
diff --git a/share/scripts/curl.d/0001-debconf.templates b/share/get-scripts/curl.d/0001-debconf.templates
index c87e47e..c63994d 100644
--- a/share/scripts/curl.d/0001-debconf.templates
+++ b/share/get-scripts/curl.d/0001-debconf.templates
@@ -8,4 +8,4 @@ Default:
Choices-C: ${CHOICES_C}
Choices: ${CHOICES}
Description: Container list:
- Select the system to use for creating the container.
+ Select the system to use for downloading the container.