Subversion Repositories ALCASAR

Rev

Rev 2304 | Rev 3162 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2304 Rev 2596
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# $Id: alcasar-letsencrypt.sh 2304 2017-06-26 12:56:14Z tom.houdayer $
3
# $Id: alcasar-letsencrypt.sh 2596 2018-08-19 23:28:45Z tom.houdayer $
4
#
4
#
5
# alcasar-letsencrypt.sh
5
# alcasar-letsencrypt.sh
6
# by Tom HOUDAYER
6
# by Tom HOUDAYER
7
#
7
#
8
# This script is distributed under the Gnu General Public License (GPL)
8
# This script is distributed under the Gnu General Public License (GPL)
Line 45... Line 45...
45
	else
45
	else
46
		emailField=""
46
		emailField=""
47
	fi
47
	fi
48
 
48
 
49
	$DEBUG && debugOpt=" --debug" || debugOpt=""
49
	$DEBUG && debugOpt=" --debug" || debugOpt=""
-
 
50
	[ ! -z "$DNS_API" ] && dnsApiOpt="$DNS_API" || dnsApiOpt="--yes-I-know-dns-manual-mode-enough-go-ahead-please"
50
	$ACMESH_BIN --config-home $ACMESH_HOME/data \
51
	$ACMESH_BIN --config-home $ACMESH_HOME/data \
51
		$STAGING_SERVER $FORCE $debugOpt \
52
		$STAGING_SERVER $FORCE $debugOpt \
52
		$emailField \
53
		$emailField \
53
		--issue --dns $DNS_API -d $DOMAIN \
54
		--issue --dns $dnsApiOpt -d $DOMAIN \
54
		$OPT_PARAMS \
55
		$OPT_PARAMS \
55
		> $TMP_OUTPUT 2>&1
56
		> $TMP_OUTPUT 2>&1
56
	exitCode=$?
57
	exitCode=$?
57
 
58
 
58
	$DEBUG && cat $TMP_OUTPUT && echo -e "\n\n"
59
	$DEBUG && cat $TMP_OUTPUT && echo -e "\n\n"
Line 87... Line 88...
87
	fi
88
	fi
88
 
89
 
89
	TMP_OUTPUT=$(mktemp --suffix=_ALCASAR-LE)
90
	TMP_OUTPUT=$(mktemp --suffix=_ALCASAR-LE)
90
 
91
 
91
	$DEBUG && debugOpt=" --debug" || debugOpt=""
92
	$DEBUG && debugOpt=" --debug" || debugOpt=""
-
 
93
	[ ! -z "$DNS_API" ] && dnsApiOpt="" || dnsApiOpt="--yes-I-know-dns-manual-mode-enough-go-ahead-please"
92
	$ACMESH_BIN --config-home $ACMESH_HOME/data \
94
	$ACMESH_BIN --config-home $ACMESH_HOME/data \
93
		$STAGING_SERVER $FORCE $debugOpt \
95
		$STAGING_SERVER $FORCE $debugOpt \
94
		--renew -d $DOMAIN \
96
		--renew -d $DOMAIN $dnsApiOpt \
95
		$OPT_PARAMS \
97
		$OPT_PARAMS \
96
		> $TMP_OUTPUT 2>&1
98
		> $TMP_OUTPUT 2>&1
97
	exitCode=$?
99
	exitCode=$?
98
 
100
 
99
	$DEBUG && cat $TMP_OUTPUT && echo -e "\n\n"
101
	$DEBUG && cat $TMP_OUTPUT && echo -e "\n\n"
Line 207... Line 209...
207
 
209
 
208
################################################################################
210
################################################################################
209
#                                     MAIN                                     #
211
#                                     MAIN                                     #
210
################################################################################
212
################################################################################
211
 
213
 
212
nb_args=$#
-
 
213
args=$1
-
 
214
 
-
 
215
if [ $nb_args -eq 0 ]; then
214
if [ $# -eq 0 ]; then
216
	echo "$usage"
215
	echo "$usage"
217
	exit 1
216
	exit 1
218
fi
217
fi
219
 
218
 
220
cmd=""
219
cmd=""