Update caddy-jail.sh

master
basilhendroff 2020-07-29 01:36:53 +08:00 committed by GitHub
parent 3d0c594919
commit abf8038fe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 25 deletions

View File

@ -29,9 +29,6 @@ SELFSIGNED_CERT=0
DNS_CERT=0
NO_CERT=0
JAILS_MOUNT=$(zfs get -H -o value mountpoint $(iocage get -p)/iocage)
RELEASE=$(freebsd-version | sed "s/STABLE/RELEASE/g" | sed "s/-p[0-9]*//")
# Check for caddy-config and set configuration
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "${SCRIPT}")
@ -42,6 +39,9 @@ fi
. "${SCRIPTPATH}/${CONFIG_NAME}"
INCLUDES_PATH="${SCRIPTPATH}"/includes
JAILS_MOUNT=$(zfs get -H -o value mountpoint $(iocage get -p)/iocage)
RELEASE=$(freebsd-version | sed "s/STABLE/RELEASE/g" | sed "s/-p[0-9]*//")
# Check that necessary variables were set by nextcloud-config
if [ -z "${JAIL_IP}" ]; then
echo 'Configuration error: JAIL_IP must be set'
@ -78,23 +78,6 @@ if [ $STANDALONE_CERT -eq 1 ] && [ $DNS_CERT -eq 1 ] ; then
exit 1
fi
if [ $DNS_CERT -eq 1 ] && [ -z "${DNS_PLUGIN}" ] ; then
echo "DNS_PLUGIN must be set to a supported DNS provider."
echo "See https://caddyserver.com/docs under the heading of \"DNS Providers\" for list."
echo "Be sure to omit the prefix of \"tls.dns.\"."
exit 1
fi
#if [ $DNS_CERT -eq 1 ] && [ -z "${DNS_ENV}" ] ; then
# echo "DNS_ENV must be set to a your DNS provider\'s authentication credentials."
# echo "See https://caddyserver.com/docs under the heading of \"DNS Providers\" for more."
# exit 1
#fi
#if [ $DNS_CERT -eq 1 ] ; then
# DL_FLAGS="tls.dns.${DNS_PLUGIN}"
# DNS_SETTING="dns ${DNS_PLUGIN}"
#fi
#####
#
# Jail Creation
@ -111,9 +94,9 @@ cat <<__EOF__ >/tmp/pkg.json
__EOF__
# Create the jail and install previously listed packages
#if ! iocage create --name "${JAIL_NAME}" -p /tmp/pkg.json -r "${RELEASE}" interfaces="${JAIL_INTERFACES}" ip4_addr="${INTERFACE}|${IP}/${NETMASK}" defaultrouter="${DEFAULT_GW_IP}" boot="on" host_hostname="${JAIL_NAME}" vnet="${VNET}"
#then
# echo "Failed to create jail"
# exit 1
#fi
if ! iocage create --name "${JAIL_NAME}" -p /tmp/pkg.json -r "${RELEASE}" interfaces="${JAIL_INTERFACES}" ip4_addr="${INTERFACE}|${IP}/${NETMASK}" defaultrouter="${DEFAULT_GW_IP}" boot="on" host_hostname="${JAIL_NAME}" vnet="${VNET}"
then
echo "Failed to create jail"
exit 1
fi
rm /tmp/pkg.json