jean-cloud-services/services/deployer.jean-cloud.org/server.sh

27 lines
599 B
Bash
Raw Normal View History

2023-08-28 18:25:32 +00:00
#!/bin/bash
2023-10-31 15:42:06 +00:00
# TODO js (dnssec is trusting google right now)
# fetch('https://dns.google/resolve?name=deployer.jean-cloud.org&cd=true&type=a').then(r => {r.json().then(j => {for (const i in j.Answer) {console.log(j.Answer[i].data)}})})
2023-08-28 18:25:32 +00:00
echo "Content-type: text/html"
echo ""
service="$(echo "$DOCUMENT_URI" | tr -d '/\;!&<>?#[]()"*')"
2023-10-31 15:42:06 +00:00
deployer="/docker/$service/deploy_http.sh"
2023-08-28 18:25:32 +00:00
. /etc/jeancloud.env
2023-10-31 15:42:06 +00:00
if [ -z "$service" ] || [ ! -x "$deployer" ] ; then
echo "error"
else
set -a
. "/docker/$service/.env"
set +a
"$deployer" 2>&1
2023-08-28 18:25:32 +00:00
ret="$?"
if [ "$ret" -ne 0 ] ; then
2023-10-31 15:42:06 +00:00
echo 'Error'
2023-08-28 18:25:32 +00:00
else
fi