]> git.street.me.uk Git - andy/dehydrated.git/blob - letsencrypt.sh
use temporary file for DER->PEM conversion (fixes #279)
[andy/dehydrated.git] / letsencrypt.sh
1 #!/usr/bin/env bash
2
3 cat >&2 << EOF
4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5 !! letsencrypt.sh has been renamed to dehydrated !!
6 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7
8 Due to trademark violation letsencrypt.sh had to be renamed and is know called dehydrated.
9
10 To make a clean cut dehydrated doesn't use the old config locations /etc/letsencrypt.sh and
11 /usr/local/etc/letsencrypt.sh anymore, also the script file has been renamed.
12
13 If you were using the default WELLKNOWN location please also update your webserver to use /var/www/dehydrated.
14
15 You are currently running (or reading) a temporary wrapper which handles the old config locations,
16 you should update your setup to use /etc/dehydrated and the 'dehydrated' script file as soon as possible.
17
18 Script execution will continue in 10 seconds.
19 EOF
20
21 sleep 10
22
23 # parse given arguments for config
24 tmpargs=("${@}")
25 CONFIG=
26 CONFIGARG=
27 while (( ${#} )); do
28   case "${1}" in
29     --config|-f)
30       shift 1
31       CONFIGARG="${1}"
32       ;;
33     *)
34       shift 1
35       ;;
36   esac
37 done
38 set -- "${tmpargs[@]}"
39
40 # look for default config locations
41 if [[ -z "${CONFIGARG:-}" ]]; then
42   for check_config in "/etc/letsencrypt.sh" "/usr/local/etc/letsencrypt.sh" "${PWD}" "${SCRIPTDIR}"; do
43     if [[ -f "${check_config}/config" ]]; then
44       CONFIG="${check_config}/config"
45       break
46     fi
47   done
48 fi
49
50 # find dehydrated script directory
51 SOURCE="${BASH_SOURCE[0]}"
52 while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
53   DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
54   SOURCE="$(readlink "$SOURCE")"
55   [[ $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
56 done
57 DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
58
59 # add water
60 if [[ -n "${CONFIG:-}" ]]; then
61         "${DIR}/dehydrated" --config "${CONFIG}" "${@}"
62 else
63         "${DIR}/dehydrated" "${@}"
64 fi