Commit fdad4849 authored by Fabian 'xx4h' Melters's avatar Fabian 'xx4h' Melters

Use full paths in getcert and renewcert

parent 4ba5971f
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
PLUGIN="$(basename $0)"
DOMAIN="$1"
PLUGIN_PATH="$SCRIPTPATH/plugins/$PLUGIN"
PLUGIN_AUTH_PATH="$SCRIPTPATH/plugins/$PLUGIN/auth"
PLUGIN_CLEANUP_PATH="$SCRIPTPATH/plugins/$PLUGIN/cleanup"
if [ "$PLUGIN" = "getcert" ]; then
echo "You cannot use 'getcert' directly, use one of the supported plugins"
exit 0
elif [ ! -d "plugins/$PLUGIN" ]; then
elif [ ! -d "$PLUGIN_PATH" ]; then
echo "There is no Plugin '$PLUGIN'"
exit 0
fi
if [ ! -f "plugins/$PLUGIN/auth" ]; then
if [ ! -f "$PLUGIN_AUTH_PATH" ]; then
echo "The auth script for Plugin '$PLUGIN' is missing"
exit 0
fi
if [ ! -f "plugins/$PLUGIN/cleanup" ]; then
if [ ! -f "$PLUGIN_CLEANUP_PATH" ]; then
echo "The cleanup script for Plugin '$PLUGIN' is missing"
exit 0
fi
......@@ -27,4 +32,4 @@ if [ "$DOMAIN" = "" ]; then
fi
certbot certonly -n --manual-public-ip-logging-ok --manual --preferred-challenges=dns --manual-auth-hook plugins/$PLUGIN/auth --manual-cleanup-hook plugins/$PLUGIN/cleanup -d $DOMAIN
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
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
PLUGIN="$(basename ${0/-renew})"
DOMAIN="$1"
PLUGIN_PATH="$SCRIPTPATH/plugins/$PLUGIN"
PLUGIN_AUTH_PATH="$SCRIPTPATH/plugins/$PLUGIN/auth"
PLUGIN_CLEANUP_PATH="$SCRIPTPATH/plugins/$PLUGIN/cleanup"
if [ "$PLUGIN" = "renewcert" ]; then
echo "You cannot use 'renewcert' directly, use one of the supported plugins"
exit 0
elif [ ! -d "plugins/$PLUGIN" ]; then
elif [ ! -d "$PLUGIN_PATH=" ]; then
echo "There is no Plugin '$PLUGIN'"
exit 0
fi
if [ ! -f "plugins/$PLUGIN/auth" ]; then
if [ ! -f "$PLUGIN_AUTH_PATH" ]; then
echo "The auth script for Plugin '$PLUGIN' is missing"
exit 0
fi
if [ ! -f "plugins/$PLUGIN/cleanup" ]; then
if [ ! -f "$PLUGIN_CLEANUP_PATH" ]; then
echo "The cleanup script for Plugin '$PLUGIN' is missing"
exit 0
fi
......@@ -27,4 +32,4 @@ if [ "$DOMAIN" = "" ]; then
fi
certbot renew -n --cert-name $DOMAIN --manual --preferred-challenges=dns --manual-auth-hook plugins/$PLUGIN/auth --manual-cleanup-hook plugins/$PLUGIN/cleanup
certbot renew -n --cert-name $DOMAIN --manual --preferred-challenges=dns --manual-auth-hook $PLUGIN_AUTH_PATH --manual-cleanup-hook $PLUGIN_CLEANUP_PATH
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment