summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Rößler2014-07-02 16:00:04 +0200
committerChristian Rößler2014-07-02 16:00:04 +0200
commitc7b719c227402ba02889bdf9af5dc9a7747b2e11 (patch)
tree37161f6336850767ff7e38d3b71e5c235b3d2c0f
parent[SSPS] Bug fix: mysql-passwords (bwLehrpool) not set correctly (diff)
downloadsetup-scripts-c7b719c227402ba02889bdf9af5dc9a7747b2e11.tar.gz
setup-scripts-c7b719c227402ba02889bdf9af5dc9a7747b2e11.tar.xz
setup-scripts-c7b719c227402ba02889bdf9af5dc9a7747b2e11.zip
[SSPS] Some more include tidying.
-rw-r--r--satellit_installer/includes/10-unpack_tar_gz.inc23
1 files changed, 23 insertions, 0 deletions
diff --git a/satellit_installer/includes/10-unpack_tar_gz.inc b/satellit_installer/includes/10-unpack_tar_gz.inc
new file mode 100644
index 0000000..a5c8852
--- /dev/null
+++ b/satellit_installer/includes/10-unpack_tar_gz.inc
@@ -0,0 +1,23 @@
+unpack_tar_gz() {
+ local dir
+ echo
+ echo -n "# Unpacking given tar file $1, using extra options $2 ..."
+ # Check whether the given directory (via -C) exists; if not mkdir it:
+ if [ "${2:0:2}" == "-C" ]; then
+ dir="${2:3}"
+ if [ "${dir:0:1}" != '/' ]; then
+ echo -n " (Warning: Path $dir has no preceding slash - not an absolute path!) "
+ fi
+ [ ! -d "$dir" ] && mkdir -p "$dir" # well, mkdir it.
+ fi
+
+ tar xzf "$1" $2
+ ERR=$?
+ if [ "$ERR" -ne 0 ]; then
+ echo
+ echo "# Could not unpack tar file $1!"
+ # Fehlerbehandlung?
+ else
+ echo "ok."
+ fi
+}