Pass $HOST to individual script with a --host parameter

This avoids ambiguity on distributions (such as openSUSE) where the
HOST environment variable already is set, to the hostname.
This commit is contained in:
Martin Storsjö committed 2019-11-13 12:55:39 +02:00
1 parent b5ae2b5cc7
commit 577400a5f7
5 files changed
+39 -14

No files matched your search

+14 -2
View File
@@ -2,11 +2,23 @@
set -e
if [ $# -lt 1 ]; then
unset HOST
while [ $# -gt 0 ]; do
case "$1" in
--host=*)
HOST="${1#*=}"
;;
*)
PREFIX="$1"
;;
esac
shift
done
if [ -z "$PREFIX" ]; then
echo $0 dest
exit 1
fi
PREFIX="$1"
mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"