forked from freddy36/StartSSL_API
-
Notifications
You must be signed in to change notification settings - Fork 2
/
startssl
executable file
·38 lines (31 loc) · 1.05 KB
/
startssl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
STARTSSL_API_PATH="$DIR/"
PYTHON="python2"
COMMAND=$1
EXECUTABLE=$STARTSSL_API_PATH"startssl_"$COMMAND".py"
if [[ -e $EXECUTABLE ]]; then
$PYTHON $EXECUTABLE ${@:2}
else
echo Usage: $0 COMMAND [args]
echo
echo "Commands:"
echo " auth"
echo " Request an authentication token"
echo " validate"
echo " If run without arguments, it prints all your validated domains"
echo " validate DOMAIN"
echo " Ask startssl to send you a validation code"
echo " validate DOMAIN CODE"
echo " Enter the validation code you received"
echo " getcerts"
echo " getcerts ID"
echo " certify CERTNAME"
echo ""
fi