Traefik fixes
This commit is contained in:
parent
43a2047e11
commit
320d4e7eb2
@ -145,18 +145,25 @@ EOF
|
|||||||
msg_ok "Template Created"
|
msg_ok "Template Created"
|
||||||
|
|
||||||
msg_info "Creating Helper Scripts"
|
msg_info "Creating Helper Scripts"
|
||||||
install -Dm0755 /dev/stdin /usr/local/bin/addsite <<'EOF'
|
cat <<'EOF' >/usr/bin/addsite
|
||||||
#!/usr/bin/env bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
function setup_site() {
|
||||||
hostname="$(whiptail --inputbox 'Enter the hostname of the Site' 8 78 --title 'Hostname' 3>&1 1>&2 2>&3)" || exit 0
|
hostname="$(whiptail --inputbox "Enter the hostname of the Site" 8 78 --title "Hostname" 3>&1 1>&2 2>&3)"
|
||||||
FQDN="$(whiptail --inputbox 'Enter the FQDN of the Site' 8 78 --title 'FQDN' 3>&1 1>&2 2>&3)" || exit 0
|
exitstatus=$?
|
||||||
URL="$(whiptail --inputbox 'Enter the URL of the Site (e.g. http://192.168.x.x:8080)' 8 78 --title 'URL' 3>&1 1>&2 2>&3)" || exit 0
|
[[ "$exitstatus" = 1 ]] && return;
|
||||||
mkdir -p /etc/traefik/sites-available
|
FQDN="$(whiptail --inputbox "Enter the FQDN of the Site" 8 78 --title "FQDN" 3>&1 1>&2 2>&3)"
|
||||||
filename="/etc/traefik/sites-available/${hostname}.yaml"
|
exitstatus=$?
|
||||||
export hostname FQDN URL
|
[[ "$exitstatus" = 1 ]] && return;
|
||||||
envsubst '${hostname} ${FQDN} ${URL}' < /etc/traefik/template.yaml.tpl > "$filename"
|
URL="$(whiptail --inputbox "Enter the URL of the Site (For example http://192.168.x.x:8080)" 8 78 --title "URL" 3>&1 1>&2 2>&3)"
|
||||||
echo "Wrote $filename"
|
exitstatus=$?
|
||||||
|
[[ "$exitstatus" = 1 ]] && return;
|
||||||
|
filename="/etc/traefik/sites-available/${hostname}.yaml"
|
||||||
|
export hostname FQDN URL
|
||||||
|
envsubst '${hostname} ${FQDN} ${URL}' < /etc/traefik/template.yaml.tpl > ${filename}
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_site
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<'EOF' >/usr/bin/ensite
|
cat <<'EOF' >/usr/bin/ensite
|
||||||
|
Loading…
x
Reference in New Issue
Block a user