Skip to content

Instantly share code, notes, and snippets.

@phmLabs
Last active October 20, 2017 20:30
Show Gist options
  • Save phmLabs/cb4a5346c428360cf07c46558b3e3479 to your computer and use it in GitHub Desktop.
Save phmLabs/cb4a5346c428360cf07c46558b3e3479 to your computer and use it in GitHub Desktop.
Lets encrypt
#!/bin/bash
a=$(/usr/bin/php /root/acmephp.phar authorize $1)
file=`echo "$a" | grep -o "challenge\/[a-zA-Z0-9\_\.\-]*" | cut -c11-100`
filename="/var/www/vhost/$1/htdocs/.well-known/acme-challenge/$file"
echo "$filename"
secret=`echo "$a" | grep -o "that the URL [a-zA-Z0-9\_\.\-]*" | cut -c14-100`
echo "$secret" > $filename
php ./acmephp.phar check -s http $1
rm $filename
php ./acmephp.phar request $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment