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