...
 
Commits (2)
*.ini
plugins/*/config
......@@ -3,6 +3,7 @@
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
PLUGIN="$(basename $0)"
DOMAIN="$1"
EMAIL="$2"
PLUGIN_PATH="$SCRIPTPATH/plugins/$PLUGIN"
PLUGIN_AUTH_PATH="$SCRIPTPATH/plugins/$PLUGIN/auth"
......@@ -27,9 +28,17 @@ if [ ! -f "$PLUGIN_CLEANUP_PATH" ]; then
fi
if [ "$DOMAIN" = "" ]; then
echo "Usage: $PLUGIN DOMAIN"
echo "Please specify a Domain"
echo "Usage: $PLUGIN DOMAIN EMAIL"
exit 0
fi
if [ "$EMAIL" = "" ]; then
echo "Please specify an Email"
echo "Usage: $PLUGIN DOMAIN EMAIL"
exit 0
fi
certbot certonly -n --manual-public-ip-logging-ok --manual --preferred-challenges=dns --manual-auth-hook $PLUGIN_AUTH_PATH --manual-cleanup-hook $PLUGIN_CLEANUP_PATH -d $DOMAIN
certbot certonly -n --manual-public-ip-logging-ok --agree-tos --email $EMAIL --manual --preferred-challenges=dns --manual-auth-hook $PLUGIN_AUTH_PATH --manual-cleanup-hook $PLUGIN_CLEANUP_PATH -d $DOMAIN
#!/bin/bash
# create dns entry via rndc
#
# $dns_entry = $client->dns_txt_get($session_id, array('name' => "_acme-challenge.".$certbot_domain."."));
# "name" => "_acme-challenge.".$certbot_domain.".",
# "type" => "TXT",
# "data" => $certbot_validation,
# "ttl" => 60,
# "active" => "Y"
# );
# msg("Adding following $certbot_validation to Entry: ".print_r($dns_entry, true));
#
PLUGIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
if [ ! -f $PLUGIN_DIR/config ]; then
echo "No config file detected. Aborting."
exit 1
fi
. $PLUGIN_DIR/config
CURRENT_DOMAIN="$(echo $CERTBOT_DOMAIN | perl -lne 'print $1 if (m(([^.]+\.[^.]+$)))')"
nsupdate -v -y $RNDC_KEY:$RNDC_SECRET << EOF
server $RNDC_HOST
zone $CURRENT_DOMAIN
update delete _acme-challenge.$CERTBOT_DOMAIN
update add _acme-challenge.$CERTBOT_DOMAIN 60 IN TXT "$CERTBOT_VALIDATION"
show
send
EOF
sleep $WAIT_SECONDS
#!/bin/bash
PLUGIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
if [ ! -f $PLUGIN_DIR/config ]; then
echo "No config file detected. Aborting."
exit 1
fi
. $PLUGIN_DIR/config
CURRENT_DOMAIN="$(echo $CERTBOT_DOMAIN | perl -lne 'print $1 if (m(([^.]+\.[^.]+$)))')"
nsupdate -v -y $RNDC_KEY:$RNDC_SECRET << EOF
server $RNDC_HOST
zone $CURRENT_DOMAIN
update delete _acme-challenge.$CERTBOT_DOMAIN
show
send
EOF
RNDC_HOST=""
RNDC_KEY=""
RNDC_SECRET=""
WAIT_SECONDS=120
DEBUG=1
#!/bin/bash
if [ "$DEPLOY_SERVICES" != "" ]; then
echo "$DEPLOY_SERVICES" | sed -e 's/,/\n/g' | while read service; do
( ( systemctl status $service >/dev/null 2>&1 && systemctl reload $service ) || ( service $service status >/dev/null 2>&1 && service $service reload ) ) || echo "$service could not be reloaded"
done
fi
......@@ -39,4 +39,4 @@ if [ "$SERVICES" != "" ] && [ -x "$PLUGIN_DEPLOY_PATH" ]; then
fi
echo certbot renew -n --cert-name $DOMAIN --manual --preferred-challenges=dns --manual-auth-hook $PLUGIN_AUTH_PATH --manual-cleanup-hook $PLUGIN_CLEANUP_PATH $DEPLOY_HOOK
certbot renew -n --cert-name $DOMAIN --manual --preferred-challenges=dns --manual-auth-hook $PLUGIN_AUTH_PATH --manual-cleanup-hook $PLUGIN_CLEANUP_PATH $DEPLOY_HOOK
getcert
\ No newline at end of file
renewcert
\ No newline at end of file