Commit e8b24560 authored by Philip Schildkamp's avatar Philip Schildkamp

Normalize quotes

parent 8eee4cce
......@@ -2,26 +2,27 @@
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=couchdb
CONFIGURE_VERSION=1.6.1
CONFIGURE_PACKAGE="couchdb"
CONFIGURE_VERSION="1.6.1"
# ----------------------------------------------------------------------------
CONFIGURE_CSARDIR=$(find ~ -maxdepth 1 -path "*.csar")
CONFIGURE_DBMSAPI=http://$DBUser:$DBPassword@127.0.0.1:$DBMSPort
CONFIGURE_CSARDIR="$(find ~ -maxdepth 1 -path "*.csar")"
CONFIGURE_DBMSAPI="http://$DBUser:$DBPassword@127.0.0.1:$DBMSPort"
}
# configure
fn_configure() {
while read -rd ';' TUPLE; do FILE="${TUPLE#*,}"
test "${FILE%.json}" == "$FILE" && continue
curl -sX POST $CONFIGURE_DBMSAPI/$DBName/_bulk_docs \
curl -sX POST "$CONFIGURE_DBMSAPI/$DBName/_bulk_docs" \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
done <<< "$DAs"
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_configure \
......
......@@ -2,26 +2,27 @@
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=couchdb
CONFIGURE_VERSION=1.6.1
CONFIGURE_PACKAGE="couchdb"
CONFIGURE_VERSION="1.6.1"
# ----------------------------------------------------------------------------
CONFIGURE_CSARDIR=$(find ~ -maxdepth 1 -path "*.csar")
CONFIGURE_DBMSAPI=http://$DBUser:$DBPassword@127.0.0.1:$DBMSPort
CONFIGURE_CSARDIR="$(find ~ -maxdepth 1 -path "*.csar")"
CONFIGURE_DBMSAPI="http://$DBUser:$DBPassword@127.0.0.1:$DBMSPort"
}
# configure
fn_configure() {
while read -rd ';' TUPLE; do FILE="${TUPLE#*,}"
test "${FILE%.json}" == "$FILE" && continue
curl -sX POST $CONFIGURE_DBMSAPI/$DBName/_bulk_docs \
curl -sX POST "$CONFIGURE_DBMSAPI/$DBName/_bulk_docs" \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
done <<< "$DAs"
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_configure \
......
......@@ -2,26 +2,27 @@
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=couchdb
CONFIGURE_VERSION=2.3.1
CONFIGURE_PACKAGE="couchdb"
CONFIGURE_VERSION="2.3.1"
# ----------------------------------------------------------------------------
CONFIGURE_CSARDIR=$(find ~ -maxdepth 1 -path "*.csar")
CONFIGURE_DBMSAPI=http://$DBUser:$DBPassword@127.0.0.1:$DBMSPort
CONFIGURE_CSARDIR="$(find ~ -maxdepth 1 -path "*.csar")"
CONFIGURE_DBMSAPI="http://$DBUser:$DBPassword@127.0.0.1:$DBMSPort"
}
# configure
fn_configure() {
while read -rd ';' TUPLE; do FILE="${TUPLE#*,}"
test "${FILE%.json}" == "$FILE" && continue
curl -sX POST $CONFIGURE_DBMSAPI/$DBName/_bulk_docs \
curl -sX POST "$CONFIGURE_DBMSAPI/$DBName/_bulk_docs" \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
done <<< "$DAs"
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_configure \
......
......@@ -2,26 +2,27 @@
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=couchdb
CONFIGURE_VERSION=2.3.1
CONFIGURE_PACKAGE="couchdb"
CONFIGURE_VERSION="2.3.1"
# ----------------------------------------------------------------------------
CONFIGURE_CSARDIR=$(find ~ -maxdepth 1 -path "*.csar")
CONFIGURE_DBMSAPI=http://$DBUser:$DBPassword@127.0.0.1:$DBMSPort
CONFIGURE_CSARDIR="$(find ~ -maxdepth 1 -path "*.csar")"
CONFIGURE_DBMSAPI="http://$DBUser:$DBPassword@127.0.0.1:$DBMSPort"
}
# configure
fn_configure() {
while read -rd ';' TUPLE; do FILE="${TUPLE#*,}"
test "${FILE%.json}" == "$FILE" && continue
curl -sX POST $CONFIGURE_DBMSAPI/$DBName/_bulk_docs \
curl -sX POST "$CONFIGURE_DBMSAPI/$DBName/_bulk_docs" \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
done <<< "$DAs"
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_configure \
......
......@@ -2,23 +2,23 @@
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=couchdb
INSTALL_VERSION=1.6.1
INSTALL_PACKAGE="couchdb"
INSTALL_VERSION="1.6.1"
# ----------------------------------------------------------------------------
INSTALL_DBMSAPI=http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort
INSTALL_DBMSAPI="http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort"
INSTALL_WARRANT="\"version\":\"$INSTALL_VERSION\""
}
# install
fn_install() {
which curl || sudo apt-get -qy install curl
grep -q "$INSTALL_WARRANT" <<< "$(curl -s $INSTALL_DBMSAPI)" || return 1
grep -q '"error":"not_found"' <<< $(curl -s $INSTALL_DBMSAPI/_users) \
&& curl -sX PUT $INSTALL_DBMSAPI/_users
grep -q "$INSTALL_WARRANT" <<< "$(curl -s "$INSTALL_DBMSAPI")" || return 1
grep -q '"error":"not_found"' <<< "$(curl -s "$INSTALL_DBMSAPI/_users")" \
&& curl -sX PUT "$INSTALL_DBMSAPI/_users"
curl -sX PUT $INSTALL_DBMSAPI/$DBName
curl -sX PUT "$INSTALL_DBMSAPI/$DBName"
curl -sX PUT $INSTALL_DBMSAPI/_users/org.couchdb.user:$DBUser \
curl -sX PUT "$INSTALL_DBMSAPI/_users/org.couchdb.user:$DBUser" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"$DBUser\",
......@@ -27,7 +27,7 @@ fn_install() {
\"type\": \"user\"
}"
curl -sX PUT $INSTALL_DBMSAPI/$DBName/_security \
curl -sX PUT "$INSTALL_DBMSAPI/$DBName/_security" \
-H "Content-Type: application/json" \
-d "{
\"admins\": {
......@@ -37,7 +37,7 @@ fn_install() {
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
......
......@@ -2,23 +2,23 @@
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=couchdb
INSTALL_VERSION=1.6.1
INSTALL_PACKAGE="couchdb"
INSTALL_VERSION="1.6.1"
# ----------------------------------------------------------------------------
INSTALL_DBMSAPI=http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort
INSTALL_DBMSAPI="http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort"
INSTALL_WARRANT="\"version\":\"$INSTALL_VERSION\""
}
# install
fn_install() {
which curl || sudo apt-get -qy install curl
grep -q "$INSTALL_WARRANT" <<< "$(curl -s $INSTALL_DBMSAPI)" || return 1
grep -q '"error":"not_found"' <<< $(curl -s $INSTALL_DBMSAPI/_users) \
&& curl -sX PUT $INSTALL_DBMSAPI/_users
grep -q "$INSTALL_WARRANT" <<< "$(curl -s "$INSTALL_DBMSAPI")" || return 1
grep -q '"error":"not_found"' <<< "$(curl -s "$INSTALL_DBMSAPI/_users")" \
&& curl -sX PUT "$INSTALL_DBMSAPI/_users"
curl -sX PUT $INSTALL_DBMSAPI/$DBName
curl -sX PUT "$INSTALL_DBMSAPI/$DBName"
curl -sX PUT $INSTALL_DBMSAPI/_users/org.couchdb.user:$DBUser \
curl -sX PUT "$INSTALL_DBMSAPI/_users/org.couchdb.user:$DBUser" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"$DBUser\",
......@@ -27,7 +27,7 @@ fn_install() {
\"type\": \"user\"
}"
curl -sX PUT $INSTALL_DBMSAPI/$DBName/_security \
curl -sX PUT "$INSTALL_DBMSAPI/$DBName/_security" \
-H "Content-Type: application/json" \
-d "{
\"admins\": {
......@@ -37,7 +37,7 @@ fn_install() {
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
......
......@@ -2,23 +2,23 @@
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=couchdb
INSTALL_VERSION=2.3.1
INSTALL_PACKAGE="couchdb"
INSTALL_VERSION="2.3.1"
# ----------------------------------------------------------------------------
INSTALL_DBMSAPI=http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort
INSTALL_DBMSAPI="http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort"
INSTALL_WARRANT="\"version\":\"$INSTALL_VERSION\""
}
# install
fn_install() {
which curl || sudo apt-get -qy install curl
grep -q "$INSTALL_WARRANT" <<< "$(curl -s $INSTALL_DBMSAPI)" || return 1
grep -q '"error":"not_found"' <<< $(curl -s $INSTALL_DBMSAPI/_users) \
&& curl -sX PUT $INSTALL_DBMSAPI/_users
grep -q "$INSTALL_WARRANT" <<< "$(curl -s "$INSTALL_DBMSAPI")" || return 1
grep -q '"error":"not_found"' <<< "$(curl -s "$INSTALL_DBMSAPI/_users")" \
&& curl -sX PUT "$INSTALL_DBMSAPI/_users"
curl -sX PUT $INSTALL_DBMSAPI/$DBName
curl -sX PUT "$INSTALL_DBMSAPI/$DBName"
curl -sX PUT $INSTALL_DBMSAPI/_users/org.couchdb.user:$DBUser \
curl -sX PUT "$INSTALL_DBMSAPI/_users/org.couchdb.user:$DBUser" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"$DBUser\",
......@@ -27,7 +27,7 @@ fn_install() {
\"type\": \"user\"
}"
curl -sX PUT $INSTALL_DBMSAPI/$DBName/_security \
curl -sX PUT "$INSTALL_DBMSAPI/$DBName/_security" \
-H "Content-Type: application/json" \
-d "{
\"admins\": {
......@@ -37,7 +37,7 @@ fn_install() {
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
......
......@@ -2,23 +2,23 @@
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=couchdb
INSTALL_VERSION=2.3.1
INSTALL_PACKAGE="couchdb"
INSTALL_VERSION="2.3.1"
# ----------------------------------------------------------------------------
INSTALL_DBMSAPI=http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort
INSTALL_DBMSAPI="http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort"
INSTALL_WARRANT="\"version\":\"$INSTALL_VERSION\""
}
# install
fn_install() {
which curl || sudo apt-get -qy install curl
grep -q "$INSTALL_WARRANT" <<< "$(curl -s $INSTALL_DBMSAPI)" || return 1
grep -q '"error":"not_found"' <<< $(curl -s $INSTALL_DBMSAPI/_users) \
&& curl -sX PUT $INSTALL_DBMSAPI/_users
grep -q "$INSTALL_WARRANT" <<< "$(curl -s "$INSTALL_DBMSAPI")" || return 1
grep -q '"error":"not_found"' <<< "$(curl -s "$INSTALL_DBMSAPI/_users")" \
&& curl -sX PUT "$INSTALL_DBMSAPI/_users"
curl -sX PUT $INSTALL_DBMSAPI/$DBName
curl -sX PUT "$INSTALL_DBMSAPI/$DBName"
curl -sX PUT $INSTALL_DBMSAPI/_users/org.couchdb.user:$DBUser \
curl -sX PUT "$INSTALL_DBMSAPI/_users/org.couchdb.user:$DBUser" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"$DBUser\",
......@@ -27,7 +27,7 @@ fn_install() {
\"type\": \"user\"
}"
curl -sX PUT $INSTALL_DBMSAPI/$DBName/_security \
curl -sX PUT "$INSTALL_DBMSAPI/$DBName/_security" \
-H "Content-Type: application/json" \
-d "{
\"admins\": {
......@@ -37,7 +37,7 @@ fn_install() {
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
......
......@@ -2,30 +2,31 @@
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=couchdb
CONFIGURE_VERSION=1.6.1
CONFIGURE_PACKAGE="couchdb"
CONFIGURE_VERSION="1.6.1"
# ----------------------------------------------------------------------------
CONFIGURE_CONFDIR=/etc/$CONFIGURE_PACKAGE
CONFIGURE_CONFDIR="/etc/$CONFIGURE_PACKAGE"
}
# configure
fn_configure() {
test -d $CONFIGURE_CONFDIR || return 1
test -d "$CONFIGURE_CONFDIR" || return 1
sudo tee $CONFIGURE_CONFDIR/local.d/10-admins.ini \
sudo tee "$CONFIGURE_CONFDIR/local.d/10-admins.ini" \
<<< "[admins]"$'\n'"$DBMSUser = $DBMSPassword"
sudo tee $CONFIGURE_CONFDIR/local.d/10-bind-port.ini \
<<< "[httpd]"$'\n'"port = $DBMSPort"
sudo tee "$CONFIGURE_CONFDIR/local.d/10-bindings.ini" \
<<< "[httpd]"$'\n'"bind_address = 0.0.0.0"$'\n'"port = $DBMSPort"
sudo mkdir /run/$CONFIGURE_PACKAGE
sudo chown couchdb:couchdb /run/$CONFIGURE_PACKAGE
sudo chown couchdb:couchdb $CONFIGURE_CONFDIR/local.d/*
sudo mkdir "/run/$CONFIGURE_PACKAGE"
sudo chown couchdb:couchdb "/run/$CONFIGURE_PACKAGE"
sudo chown couchdb:couchdb "$CONFIGURE_CONFDIR/local.d/"*
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_configure \
......
......@@ -2,30 +2,31 @@
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=couchdb
CONFIGURE_VERSION=1.6.1
CONFIGURE_PACKAGE="couchdb"
CONFIGURE_VERSION="1.6.1"
# ----------------------------------------------------------------------------
CONFIGURE_CONFDIR=/etc/$CONFIGURE_PACKAGE
CONFIGURE_CONFDIR="/etc/$CONFIGURE_PACKAGE"
}
# configure
fn_configure() {
test -d $CONFIGURE_CONFDIR || return 1
test -d "$CONFIGURE_CONFDIR" || return 1
sudo tee $CONFIGURE_CONFDIR/local.d/10-admins.ini \
sudo tee "$CONFIGURE_CONFDIR/local.d/10-admins.ini" \
<<< "[admins]"$'\n'"$DBMSUser = $DBMSPassword"
sudo tee $CONFIGURE_CONFDIR/local.d/10-bind-port.ini \
<<< "[httpd]"$'\n'"port = $DBMSPort"
sudo tee "$CONFIGURE_CONFDIR/local.d/10-bindings.ini" \
<<< "[httpd]"$'\n'"bind_address = 0.0.0.0"$'\n'"port = $DBMSPort"
sudo mkdir /run/$CONFIGURE_PACKAGE
sudo chown couchdb:couchdb /run/$CONFIGURE_PACKAGE
sudo chown couchdb:couchdb $CONFIGURE_CONFDIR/local.d/*
sudo mkdir "/run/$CONFIGURE_PACKAGE"
sudo chown couchdb:couchdb "/run/$CONFIGURE_PACKAGE"
sudo chown couchdb:couchdb "$CONFIGURE_CONFDIR/local.d/"*
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_configure \
......
......@@ -2,26 +2,27 @@
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=couchdb
CONFIGURE_VERSION=2.3.1
CONFIGURE_PACKAGE="couchdb"
CONFIGURE_VERSION="2.3.1"
# ----------------------------------------------------------------------------
CONFIGURE_CONFDIR=/opt/$CONFIGURE_PACKAGE/etc
CONFIGURE_CONFDIR="/opt/$CONFIGURE_PACKAGE/etc"
}
# configure
fn_configure() {
test -d $CONFIGURE_CONFDIR || return 1
test -d "$CONFIGURE_CONFDIR" || return 1
sudo tee $CONFIGURE_CONFDIR/local.d/10-admins.ini \
sudo tee "$CONFIGURE_CONFDIR/local.d/10-admins.ini" \
<<< "[admins]"$'\n'"$DBMSUser = $DBMSPassword"
sudo tee $CONFIGURE_CONFDIR/local.d/10-bind-port.ini \
<<< "[chttpd]"$'\n'"port = $DBMSPort"
sudo tee "$CONFIGURE_CONFDIR/local.d/10-bindings.ini" \
<<< "[chttpd]"$'\n'"bind_address = 0.0.0.0"$'\n'"port = $DBMSPort"
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_configure \
......
......@@ -2,26 +2,27 @@
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=couchdb
CONFIGURE_VERSION=2.3.1
CONFIGURE_PACKAGE="couchdb"
CONFIGURE_VERSION="2.3.1"
# ----------------------------------------------------------------------------
CONFIGURE_CONFDIR=/opt/$CONFIGURE_PACKAGE/etc
CONFIGURE_CONFDIR="/opt/$CONFIGURE_PACKAGE/etc"
}
# configure
fn_configure() {
test -d $CONFIGURE_CONFDIR || return 1
test -d "$CONFIGURE_CONFDIR" || return 1
sudo tee $CONFIGURE_CONFDIR/local.d/10-admins.ini \
sudo tee "$CONFIGURE_CONFDIR/local.d/10-admins.ini" \
<<< "[admins]"$'\n'"$DBMSUser = $DBMSPassword"
sudo tee $CONFIGURE_CONFDIR/local.d/10-bind-port.ini \
<<< "[chttpd]"$'\n'"port = $DBMSPort"
sudo tee "$CONFIGURE_CONFDIR/local.d/10-bindings.ini" \
<<< "[chttpd]"$'\n'"bind_address = 0.0.0.0"$'\n'"port = $DBMSPort"
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_configure \
......
......@@ -2,10 +2,10 @@
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=couchdb
INSTALL_VERSION=1.6.1
INSTALL_PACKAGE="couchdb"
INSTALL_VERSION="1.6.1"
# ----------------------------------------------------------------------------
INSTALL_DBMSAPI=http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort
INSTALL_DBMSAPI="http://$DBMSUser:$DBMSPassword@127.0.0.1:$DBMSPort"
INSTALL_DEPENDS="
http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7ubuntu0.4_amd64.deb
http://launchpadlibrarian.net/309343863/libmozjs185-1.0_1.8.5-1.0.0+dfsg-7_amd64.deb
......@@ -16,13 +16,13 @@ fn_pkginfo() {
http://ppa.launchpad.net/couchdb/stable/ubuntu/pool/main/a/apache-couchdb/couchdb-common_1.6.1-0ubuntu6ppa2~xenial1_all.deb
"
INSTALL_DPKGDEP="esl-erlang, libicu55, libmozjs185-1.0"
INSTALL_LIBCURL=/usr/local/lib/libcurl.so.3
INSTALL_LIBCURL="/usr/local/lib/libcurl.so.3"
INSTALL_WARRANT='"version":"1.6.1"'
}
# install
fn_install() {
cd $(mktemp -d)
cd "$(mktemp -d)"
which curl || sudo apt-get -qy install curl
curl --remote-name-all $INSTALL_DEPENDS
......@@ -45,13 +45,13 @@ fn_install() {
libmozjs185-1.0
dpkg-deb --extract libcurl3* .
sudo mv $(find -type f -name '*.so.*') $INSTALL_LIBCURL
sudo mv "$(find -type f -name '*.so.*')" "$INSTALL_LIBCURL"
pushd / && rm -r $(popd)
pushd / && rm -r "$(popd)"
}
# env
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND="noninteractive"
source /etc/lsb-release
sudo apt-get -qy update
......
......@@ -2,10 +2,10 @@
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=couchdb
INSTALL_VERSION=1.6.1
INSTALL_PACKAGE="couchdb"
INSTALL_VERSION="1.6.1"
# ----------------------------------------------------------------------------