Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
NamesiloCert/hook.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
23 lines (20 sloc)
686 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://stackoverflow.com/questions/59895 | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" | |
done | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
echo "Recieved request for" "${CERTBOT_DOMAIN}" | |
cd ${DIR} | |
go run *.go "_acme-challenge.${CERTBOT_DOMAIN}" "${CERTBOT_VALIDATION}" | |
# www.varstack.com is the last domain. Records are published | |
# every 15 minutes. Wait for 16 minutes, and then proceed. | |
if [ "${CERTBOT_DOMAIN}" = "www.varstack.com" ]; then | |
for (( i=0; i<16; i++ )); do | |
echo "Minute" ${i} | |
sleep 60s | |
done | |
fi |