summaryrefslogtreecommitdiffstats
path: root/share/scripts/curl
diff options
context:
space:
mode:
Diffstat (limited to 'share/scripts/curl')
-rwxr-xr-xshare/scripts/curl28
1 files changed, 15 insertions, 13 deletions
diff --git a/share/scripts/curl b/share/scripts/curl
index 72bdec3..80ccde6 100755
--- a/share/scripts/curl
+++ b/share/scripts/curl
@@ -1,7 +1,6 @@
#!/bin/sh
-# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2018 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -20,12 +19,15 @@
set -e
+PROJECT="open-infrastructure"
+SOFTWARE="compute-tools"
+PROGRAM="container"
SCRIPT="${0}"
-HOOKS="/etc/container-tools/hooks"
-KEYS="/etc/container-tools/keys"
+HOOKS="/etc/${PROJECT}/${PROGRAM}/hooks"
+KEYS="/etc/${PROJECT}/${PROGRAM}/keys"
MACHINES="/var/lib/machines"
-CACHE="/var/cache/container-tools/system"
+CACHE="/var/cache/${PROJECT}/${PROGRAM}/system"
Parameters ()
{
@@ -172,7 +174,7 @@ then
exit 1
fi
-SERVER="${SERVER:-https://files.open-infrastructure.net/system/container/debian}"
+SERVER="${SERVER:-https://get.open-infrastructure.net/system/container/debian}"
PASSWORD="${PASSWORD:-$(dd if=/dev/urandom bs=12 count=1 2> /dev/null | base64)}"
VERSION="$(container version)"
@@ -241,8 +243,8 @@ then
# Downloading container list
if curl --fail --head --output /dev/null --silent "${SERVER}/container-list.txt"
then
- mkdir -p /tmp/container-tools
- DEBCONF_TMPDIR="$(mktemp -d -p /tmp/container-tools -t $(basename ${0}).XXXX)"
+ mkdir -p "/tmp/${SOFTWARE}"
+ DEBCONF_TMPDIR="$(mktemp -d -p "/tmp/${SOFTWARE}" -t $(basename ${0}).XXXX)"
export DEBCONF_TMPDIR
if [ -z "${ARCHITECTURE}" ]
@@ -257,7 +259,7 @@ then
GREP_PATTERN="${GREP_PATTERN:-${ARCHITECTURE}}"
echo "Downloading $(echo ${SERVER} | awk -F/ '{ print $3 }') container list"
- curl --fail --location --progress-bar --user-agent container-tools/${VERSION} ${CURL_OPTIONS} \
+ curl --fail --location --progress-bar --user-agent ${SOFTWARE}/${VERSION} ${CURL_OPTIONS} \
"${SERVER}/container-list.txt" | grep -E "${GREP_PATTERN}" > "${DEBCONF_TMPDIR}/container-list.txt"
umask 0022
@@ -265,12 +267,12 @@ then
Debconf
# Run debconf parts
- for DEBCONF_SCRIPT in /usr/share/container-tools/scripts/curl.d/*
+ for DEBCONF_SCRIPT in /usr/share/${PROJECT}/${PROGRAM}/scripts/curl.d/*
do
if [ -x "${DEBCONF_SCRIPT}" ]
then
# FIXME
- # debconf -ocontainer-tools "${DEBCONF_SCRIPT}"
+ # debconf -o${SOFTWARE} "${DEBCONF_SCRIPT}"
"${DEBCONF_SCRIPT}"
fi
done
@@ -280,7 +282,7 @@ then
# Remove debconf temporary files
rm --preserve-root --one-file-system -rf "${DEBCONF_TMPDIR}"
- rmdir --ignore-fail-on-non-empty /tmp/container-tools 2>&1 || true
+ rmdir --ignore-fail-on-non-empty "/tmp/${SOFTWARE}" 2>&1 || true
fi
fi
@@ -320,7 +322,7 @@ do
fi
echo "Downloading ${FILE}"
- curl --fail --location --progress-bar --user-agent container-tools/${VERSION} ${CURL_OPTIONS} ${CURL_TIME_COND} \
+ curl --fail --location --progress-bar --user-agent ${SOFTWARE}/${VERSION} ${CURL_OPTIONS} ${CURL_TIME_COND} \
"${SERVER}/${FILE}" -o "${CACHE}/${FILE}"
fi
done